Selling mechanism
This commit is contained in:
@ -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:
|
||||
|
Reference in New Issue
Block a user