add input function

master
Fabien Freling 2019-11-25 01:24:38 +01:00
parent 0fe5cca646
commit 53780532bf
1 changed files with 11 additions and 1 deletions

View File

@ -36,4 +36,14 @@ func _ready() -> void:
add_child(piece)
pieces_row.append(piece)
pieces.append(pieces_row)
pieces.append(pieces_row)
func _input(event):
if event.is_action_pressed("ui_up"):
print("up")
if event.is_action_pressed("ui_down"):
print("down")
if event.is_action_pressed("ui_left"):
print("left")
if event.is_action_pressed("ui_right"):
print("right")