Selling mechanism

This commit is contained in:
2025-04-29 14:29:25 +02:00
parent fc4285e99d
commit 0cc20ef435
10 changed files with 131 additions and 17 deletions

View File

@ -8,10 +8,9 @@ const COBOLD = preload("res://Game/Mobs/cobold.tscn")
const enemies = [FORKMAN, COBOLD, ORK]
var lives = 20
func _ready() -> void:
get_node("SidePanel").Update_Lives(lives)
get_node("SidePanel").Update_Lifes(20)
func _on_timer_timeout() -> void:
@ -25,9 +24,8 @@ func spawnMonster():
path_2d.add_child(path)
func decrease_life(damage) -> void:
lives -= damage
get_node("SidePanel").Update_Lives(lives)
if lives <= 0:
get_node("SidePanel").Update_Lifes(-damage)
if get_node("SidePanel").get_Lifes() <= 0:
game_over()
func game_over()-> void: