echo and exact match input
This commit is contained in:
parent
4310cd14f1
commit
82b10bdae5
1 changed files with 8 additions and 10 deletions
18
main.gd
18
main.gd
|
|
@ -23,21 +23,19 @@ func _ready() -> void:
|
|||
break
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("u"):
|
||||
if event.is_action_pressed("u", true, true):
|
||||
step(Vector2i.UP)
|
||||
elif event.is_action_pressed("d"):
|
||||
elif event.is_action_pressed("d", true, true):
|
||||
step(Vector2i.DOWN)
|
||||
elif event.is_action_pressed("l"):
|
||||
elif event.is_action_pressed("l", true, true):
|
||||
step(Vector2i.LEFT)
|
||||
elif event.is_action_pressed("r"):
|
||||
elif event.is_action_pressed("r", true, true):
|
||||
step(Vector2i.RIGHT)
|
||||
# because most redo keybinds are a superset of undo, we check them first
|
||||
# e.g. if C-Z, then C-z is pressed
|
||||
elif event.is_action_pressed("redo"):
|
||||
hist.redo()
|
||||
elif event.is_action_pressed("undo"):
|
||||
elif event.is_action_pressed("undo", true, true):
|
||||
hist.undo()
|
||||
elif event.is_action_pressed("restart"):
|
||||
elif event.is_action_pressed("redo", true, true):
|
||||
hist.redo()
|
||||
elif event.is_action_pressed("restart", true, true):
|
||||
restart()
|
||||
|
||||
# TODO:
|
||||
|
|
|
|||
Loading…
Reference in a new issue