Advertisement
otorp2

bool gate for firing

Oct 26th, 2015
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. extends Node2D
  2.  
  3. var is_pressed = false
  4.  
  5. func _ready():
  6. set_process(true)
  7. pass
  8.  
  9. func _process(delta):
  10. if Input.is_action_pressed("fire"):
  11. if is_pressed == false:
  12. print("fire")
  13. is_pressed = true
  14. else:
  15. is_pressed = false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement