Added autoshooting

This commit is contained in:
2025-11-29 21:32:36 +03:00
parent 67342c82cc
commit f42139ef9c
7 changed files with 12 additions and 42 deletions
+2 -11
View File
@@ -4,24 +4,15 @@ extends Node
signal accelerate(direction: Vector2, delta: float)
signal shoot(weapon_index: int)
signal shoot()
signal blink(direction: Vector2)
const WEAPON_ACTIONS := {
0: "shoot_weapon_1",
1: "shoot_weapon_2",
}
func _physics_process(delta: float) -> void:
var input_direction := _get_input_direction()
accelerate.emit(input_direction, delta)
for index : int in WEAPON_ACTIONS:
if Input.is_action_pressed(WEAPON_ACTIONS[index]):
shoot.emit(index)
shoot.emit()
func _input(event: InputEvent) -> void: