First godot-ci commit
This commit is contained in:
22
scripts/Base.gd
Executable file
22
scripts/Base.gd
Executable file
@@ -0,0 +1,22 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user