Sidebar and lives
This commit is contained in:
@ -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")
|
||||
|
||||
|
Reference in New Issue
Block a user