godot-ci/test-project/scripts/Base.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

22 lines
334 B
GDScript
Executable file

extends "res://scripts/ColoredEntity.gd"
const FULL_HEALTH: int = 3
var health: int = self.FULL_HEALTH
func _ready():
self.highlight()
func hit() -> void:
if health > 1:
self.health -= 1
else:
self.dead()
func dead() -> void:
pass
# --- Signals ---
func _on_Body_body_entered(body: Node):
body.queue_free()
self.hit()