Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected function hover(Object1:FlxObject, Object2:FlxObject):void{
- player.hit = true;
- testObject.x = 100;
- testObject.y = 100;
- }
- override public function update():void {
- player.acceleration.x = 0;
- player.acceleration.y = 0;
- if(FlxG.keys.RIGHT){
- player.acceleration.x = player.drag.x;
- }
- if(FlxG.keys.LEFT){
- player.acceleration.x = -player.drag.x;
- }
- if(FlxG.keys.UP){
- player.acceleration.y = -player.drag.y;
- }
- if(FlxG.keys.DOWN){
- player.acceleration.y = player.drag.y;
- }
- if (FlxG.keys.justPressed('X')){
- player.actionButton.play("pressed");
- }
- FlxU.overlap(player.hitBox, testObject, hover);
- super.update();
- }
Add Comment
Please, Sign In to add comment