godot-ci/test-project/scripts/Player.gd
Antonio Dell'Annunziata 79e2014976
Some checks are pending
godot-ci export / Windows Export (push) Waiting to run
godot-ci export / Linux Export (push) Waiting to run
godot-ci export / Web Export (push) Waiting to run
godot-ci export / Mac Export (push) Waiting to run
Adapt to forgejo
2025-03-02 11:36:40 +01:00

25 lines
433 B
GDScript
Executable file

extends "res://scripts/ColoredEntity.gd"
signal unblock
var blocked_controls: bool = true
func _ready():
self.highlight()
func _input(event):
if blocked_controls:
return
if Input.is_action_just_pressed("swap"):
GLOBAL.swap_nodes_color()
if Input.is_action_pressed("fire"):
self.shoot_bullet()
func shoot_bullet() -> void:
$Cannon.shoot()
# --- Signals ---
func _on_Player_unblock():
self.blocked_controls = false