Files
godot-ci/test-project/scripts/Base.gd
abarichello 9fd1c3aee0 Import test project as example
TODO: update gitlab-ci template to also use the test-project
2020-05-18 17:52:17 -03:00

23 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()