From c1f30a2905d7a44439c2c0797ddd87b58f79d724 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 25 Dec 2023 13:10:22 +0100 Subject: level select input support --- Global.gd | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Global.gd') diff --git a/Global.gd b/Global.gd index 9cb1001..4ff6114 100644 --- a/Global.gd +++ b/Global.gd @@ -7,7 +7,7 @@ signal game_ended() signal game_won() -var Levels = [ +var Levels = [ # should be 9 "Level_0001", "Level_0002", "Level_0003", @@ -15,7 +15,6 @@ var Levels = [ "Level_0005", "Level_0005", "Level_0004", - "Level_0003", "Level_0002", "Level_0001", ] @@ -85,7 +84,7 @@ func end_level(instance_level): for id in Network.players: rpc_id(id, "_update_level_map", instance_level.idx, global_level) - get_tree().change_scene_to_file("res://UI/LevelSelect.tscn") + (func(): get_tree().change_scene_to_file("res://UI/LevelSelect.tscn")).call_deferred() self.check_win() @@ -112,7 +111,7 @@ func end_game(): func _on_Network_game_ended(): - get_tree().change_scene_to_file("res://UI/GameOver.tscn") + (func(): get_tree().change_scene_to_file("res://UI/GameOver.tscn")).call_deferred() self.Level_Map = [] self.init() @@ -168,7 +167,7 @@ func check_win(): func check_win_timer(): var has_won = self.has_won() - if has_won: + if self.has_won(): emit_signal("game_won", Network.player) -- cgit v1.2.3