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