level bounds now don't error out on save/quit

This commit is contained in:
Derek
2025-04-04 08:21:46 -05:00
parent 32b9efbd92
commit 6cd06193b5
6 changed files with 22 additions and 14 deletions

View File

@@ -60,15 +60,7 @@ func _ready():
else:
refresh_scene()
#Spawn Crown
if GameGlobals.last_hit_path:
var crown_spawn = CROWN.instantiate()
var crown_target = get_node(GameGlobals.last_hit_path)
if crown_target:
crown_target.add_child(crown_spawn)
crown_spawn.position = Vector3(0,2,0)
if crown_target.is_in_group("enemy"):
crown_target.loot_amount = 10
spawn_crown()
#global randomize function
randomize()
@@ -104,7 +96,17 @@ func _ready():
func refresh_scene():
GameGlobals.health = gamemode.start_health
func spawn_crown():
#Spawn Crown
if GameGlobals.last_hit_path:
var crown_spawn = CROWN.instantiate()
var crown_target = get_node(GameGlobals.last_hit_path)
if crown_target:
crown_target.add_child(crown_spawn)
crown_spawn.position = Vector3(0,2,0)
if crown_target.is_in_group("enemy"):
crown_target.loot_amount = 10
func gun_spawn(index):