keyboard_control.gd 263 B

1234567891011
  1. class_name KeyboardControl
  2. extends Node
  3. # Command from keyboard input
  4. signal dir_changed(dir: Vector2)
  5. func _unhandled_key_input(event: InputEvent) -> void:
  6. var new_dir = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
  7. dir_changed.emit(new_dir)