Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         override public function update():void
  2.         {
  3.         accumulator += FlxG.elapsed;
  4.         if (accumulator >= TimeStep)
  5.         {
  6.        
  7.             if(moveRight == true)
  8.             tileGroup.velocity.x = 2000;
  9.             else if (moveRight == false)
  10.             tileGroup.velocity.x = -2000;
  11.            
  12.             if (tileGroup.x + (numberOfTiles * 40) > 40)
  13.             moveRight = false;
  14.  
  15.             if ( tileGroup.x  < 1)
  16.             moveRight = true;
  17.             FlxU.collide(tileGroup, tileGroup);
  18.             if (FlxG.keys.justPressed("ESCAPE"))
  19.             accumulator = accumulator - TimeStep;
  20.         }
  21.         super.update();
  22.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement