Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 56 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. package;
  2.  
  3. import flixel.FlxSprite;
  4. import flixel.FlxState;
  5. import flixel.graphics.FlxGraphic;
  6. import flixel.math.FlxPoint;
  7. import flixel.tile.FlxBaseTilemap.FlxTilemapAutoTiling;
  8. import flixel.tile.FlxTilemap;
  9. import flixel.util.FlxPath;
  10. import flixel.util.FlxSpriteUtil;
  11.  
  12. class PlayState extends FlxState
  13. {
  14.  
  15.     var clockwise:Bool = true;
  16.  
  17.     override public function create():Void
  18.     {
  19.         var data = [
  20.             [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  21.             [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  22.             [0, 0, 0, 0, 1, 1, 0, 0, 0, 0],
  23.             [0, 0, 1, 1, 1, 1, 0, 0, 0, 0],
  24.             [0, 0, 1, 1, 1, 1, 0, 0, 0, 0],
  25.             [0, 0, 0, 0, 1, 1, 1, 1, 0, 0],
  26.             [0, 0, 0, 0, 1, 1, 1, 1, 0, 0],
  27.             [0, 0, 0, 0, 1, 1, 0, 0, 0, 0],
  28.             [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  29.             [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  30.         ];
  31.  
  32.         bgColor = 0xFF808080;
  33.  
  34.         var level = new FlxTilemap();
  35.         level.loadMapFrom2DArray(data, FlxGraphic.fromClass(GraphicAuto), 8, 8, FlxTilemapAutoTiling.AUTO);
  36.         add(level);
  37.  
  38.         var bug = new FlxSprite(16, 16);
  39.         bug.makeGraphic(8, 8);
  40.         FlxSpriteUtil.drawRect(bug, 0, 0, 4, 8, 0xFFFF0000);
  41.         add(bug);
  42.  
  43.         bug.path = new FlxPath();
  44.         var p = (x:Int, y:Int) -> FlxPoint.get(x * 8 + 4, y * 8 + 4);
  45.         bug.path.start([p(3, 2), p(3, 1), p(6, 1), p(6, 4), p(8, 4), p(8, 7), p(6, 7), p(6, 8), p(3, 8), p(3, 5), p(1, 5), p(1, 2)], 50, FlxPath.LOOP_FORWARD, true);
  46.  
  47.         super.create();
  48.     }
  49.  
  50. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top