Advertisement
otorp2

mouse bool gate with not

Jan 2nd, 2016
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. extends Node2D
  2.  
  3. var is_mouse_pressed = false
  4.  
  5. func _ready():
  6. set_process(true)
  7.  
  8. pass
  9.  
  10. func _process(delta):
  11. update()
  12. pass
  13.  
  14. func _draw():
  15. if Input.is_mouse_button_pressed(1) && is_mouse_pressed == false:
  16. print("one shot only")
  17. is_mouse_pressed = true
  18. elif !Input.is_mouse_button_pressed(1):
  19. is_mouse_pressed = false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement