Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- override public function update():void
- {
- accumulator += FlxG.elapsed;
- if (accumulator >= TimeStep)
- {
- if(moveRight == true)
- tileGroup.velocity.x = 2000;
- else if (moveRight == false)
- tileGroup.velocity.x = -2000;
- if (tileGroup.x + (numberOfTiles * 40) > 40)
- moveRight = false;
- if ( tileGroup.x < 1)
- moveRight = true;
- FlxU.collide(tileGroup, tileGroup);
- if (FlxG.keys.justPressed("ESCAPE"))
- accumulator = accumulator - TimeStep;
- }
- super.update();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement