Advertisement
otorp2

Untitled

Nov 7th, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. extends Area2D
  2.  
  3.  
  4. var is_not_pressed = true
  5.  
  6. func _ready():
  7. set_process(true)
  8. pass
  9. func _process(delta):
  10.  
  11. if Input.is_action_pressed("ui_left"):
  12. if is_not_pressed == true:
  13. fire_left()
  14.  
  15. else:
  16. is_not_pressed = true
  17.  
  18. if Input.is_action_pressed("ui_right"):
  19. if is_not_pressed == true:
  20. fire_right()
  21.  
  22. else:
  23. is_not_pressed = true
  24.  
  25.  
  26. func fire_left():
  27.  
  28. print("fire left")
  29. is_not_pressed = false
  30.  
  31.  
  32. func fire_right():
  33.  
  34. print("fire right")
  35. is_not_pressed = false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement