lobby level

This commit is contained in:
2026-08-26 20:38:07 +03:00
parent 40c1b8e680
commit 09ae6bfbf4
3 changed files with 56 additions and 7 deletions
+9 -6
View File
@@ -217,7 +217,7 @@ func _unhandled_input(event: InputEvent) -> void:
if event is InputEventKey and event.pressed and not event.echo:
if _game_over and event.physical_keycode in [KEY_ENTER, KEY_KP_ENTER]:
if _result_win:
_continue_to_map()
_continue_to_lobby()
else:
_restart()
elif event.physical_keycode == KEY_TAB and not _game_over:
@@ -238,12 +238,15 @@ func _restart() -> void:
get_tree().reload_current_scene()
# A cleared arena advances the run: commit the win and open the map to pick the next node.
func _continue_to_map() -> void:
# A cleared level advances the run and drops the player into the lobby hub: commit the
# win, flag the lobby as the active level, then reload the shell so it builds the lobby.
# (Choosing the next map node happens from the lobby via trigger areas, added later.)
func _continue_to_lobby() -> void:
get_tree().paused = false
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
Run.complete_current_level()
get_tree().change_scene_to_file("res://levels/MapScreen.tscn")
Run.go_to_lobby()
get_tree().change_scene_to_file(Run.active_level().scene_path)
func _toggle_controls() -> void:
@@ -400,7 +403,7 @@ func _build_game_over() -> void:
# Win → Continue to the run map; loss → Go Again from the top. Shown per-result in
# _show_game_over; both share the Enter shortcut.
_over_continue = _make_button("Continue (Enter)")
_over_continue.pressed.connect(_continue_to_map)
_over_continue.pressed.connect(_continue_to_lobby)
row.add_child(_over_continue)
_over_again = _make_button("Go Again (Enter)")