Sidebar and lives

This commit is contained in:
2025-03-13 17:25:00 +01:00
parent 43d5ee2b5f
commit 491755209f
6 changed files with 92 additions and 2 deletions

View File

@ -8,6 +8,8 @@ const COBOLD = preload("res://Game/Mobs/cobold.tscn")
const enemies = [FORKMAN, COBOLD, ORK]
var lives = 20
func _on_timer_timeout() -> void:
spawnMonster()
@ -17,3 +19,10 @@ func spawnMonster():
path.add_child(monster)
path_2d.add_child(path)
func decrease_life(damage) -> void:
lives -= damage
print(lives)
if lives == 0:
print("DEAD")