Guest User

Untitled

a guest
Aug 21st, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. protected function hover(Object1:FlxObject, Object2:FlxObject):void{
  2.  
  3. player.hit = true;
  4. testObject.x = 100;
  5. testObject.y = 100;
  6.  
  7. }
  8.  
  9. override public function update():void {
  10. player.acceleration.x = 0;
  11. player.acceleration.y = 0;
  12.  
  13. if(FlxG.keys.RIGHT){
  14. player.acceleration.x = player.drag.x;
  15. }
  16. if(FlxG.keys.LEFT){
  17. player.acceleration.x = -player.drag.x;
  18. }
  19. if(FlxG.keys.UP){
  20. player.acceleration.y = -player.drag.y;
  21. }
  22. if(FlxG.keys.DOWN){
  23. player.acceleration.y = player.drag.y;
  24. }
  25.  
  26. if (FlxG.keys.justPressed('X')){
  27. player.actionButton.play("pressed");
  28.  
  29. }
  30.  
  31. FlxU.overlap(player.hitBox, testObject, hover);
  32.  
  33. super.update();
  34. }
Add Comment
Please, Sign In to add comment