|
@@ -3,11 +3,11 @@ extends Node
|
|
# Sends commands from a local device
|
|
# Sends commands from a local device
|
|
|
|
|
|
signal dir_changed(new_dir: Vector2)
|
|
signal dir_changed(new_dir: Vector2)
|
|
-signal main_action
|
|
+signal main_action(pressed: bool)
|
|
|
|
|
|
func _unhandled_input(event: InputEvent) -> void:
|
|
func _unhandled_input(event: InputEvent) -> void:
|
|
- if event.is_action_pressed("jump"):
|
|
+ if event.is_action("jump"):
|
|
- main_action.emit()
|
|
+ main_action.emit(event.is_pressed())
|
|
elif event is InputEventJoypadMotion:
|
|
elif event is InputEventJoypadMotion:
|
|
var dir: Vector2 = Input.get_vector("move_left", "move_right", "move_back", "move_forward")
|
|
var dir: Vector2 = Input.get_vector("move_left", "move_right", "move_back", "move_forward")
|
|
dir_changed.emit(dir)
|
|
dir_changed.emit(dir)
|