Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extends Area2D
- var is_not_pressed = true
- func _ready():
- set_process(true)
- pass
- func _process(delta):
- if Input.is_action_pressed("ui_left"):
- if is_not_pressed == true:
- fire_left()
- else:
- is_not_pressed = true
- if Input.is_action_pressed("ui_right"):
- if is_not_pressed == true:
- fire_right()
- else:
- is_not_pressed = true
- func fire_left():
- print("fire left")
- is_not_pressed = false
- func fire_right():
- print("fire right")
- is_not_pressed = false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement