diff --git a/game.gd b/game.gd index 891a9f3..8f4e0f5 100644 --- a/game.gd +++ b/game.gd @@ -68,8 +68,10 @@ func get_map(): #Go to new map func change_map(map): - shards_collected = [false,false,false,false,false,false,false,false,false,false] - get_map().queue_free() + clear_collectibles() + #Loop is so no more than one level is loaded at a time + for maps in get_tree().get_nodes_in_group("map"): + maps.queue_free() instance_node(map,0,0,viewport) #Clear data @@ -78,6 +80,7 @@ func clear_collectibles(): Game.golds = 0 Game.stars = [false,false,false,false,false] Game.shards = 0 + Game.shards_collected = [false,false,false,false,false,false,false,false,false,false] Game.arrows = 0 Game.lives = 2