Show defeat scene if current health less than 1

This commit is contained in:
Moe Poi ~ 2023-10-18 11:14:33 +07:00
parent 4906768091
commit 9465faaf66
6 changed files with 6 additions and 6 deletions

View file

@ -87,7 +87,7 @@ func on_enemy_entered_base(enemy):
$CanvasLayer/GameStats.set_damage(enemy.damage)
if data['health'] < 1:
print("Game Over")
get_tree().change_scene_to_file("res://scenes/ui/defeat.tscn")
func on_enemy_reward(value: int):
data['resource'] += value

View file

@ -86,7 +86,7 @@ func on_enemy_entered_base(enemy):
$CanvasLayer/GameStats.set_damage(enemy.damage)
if data['health'] < 1:
print("Game Over")
get_tree().change_scene_to_file("res://scenes/ui/defeat.tscn")
func on_enemy_reward(value: int):
data['resource'] += value

View file

@ -86,7 +86,7 @@ func on_enemy_entered_base(enemy):
$CanvasLayer/GameStats.set_damage(enemy.damage)
if data['health'] < 1:
print("Game Over")
get_tree().change_scene_to_file("res://scenes/ui/defeat.tscn")
func on_enemy_reward(value: int):
data['resource'] += value

View file

@ -86,7 +86,7 @@ func on_enemy_entered_base(enemy):
$CanvasLayer/GameStats.set_damage(enemy.damage)
if data['health'] < 1:
print("Game Over")
get_tree().change_scene_to_file("res://scenes/ui/defeat.tscn")
func on_enemy_reward(value: int):
data['resource'] += value

View file

@ -86,7 +86,7 @@ func on_enemy_entered_base(enemy):
$CanvasLayer/GameStats.set_damage(enemy.damage)
if data['health'] < 1:
print("Game Over")
get_tree().change_scene_to_file("res://scenes/ui/defeat.tscn")
func on_enemy_reward(value: int):
data['resource'] += value

View file

@ -86,7 +86,7 @@ func on_enemy_entered_base(enemy):
$CanvasLayer/GameStats.set_damage(enemy.damage)
if data['health'] < 1:
print("Game Over")
get_tree().change_scene_to_file("res://scenes/ui/defeat.tscn")
func on_enemy_reward(value: int):
data['resource'] += value