add game scene

This commit is contained in:
2025-08-03 23:22:26 +04:00
parent d9084606c8
commit 78a61fe33c
5 changed files with 50 additions and 2 deletions

View File

@@ -1,4 +1,21 @@
extends Node
func _ready():
pass
const GAME_SCENE_PATH := "res://scenes/Game.tscn"
const MAIN_SCENE_PATH := "res://scenes/Main.tscn"
func start_new_game() -> void:
var packed_scene := load(GAME_SCENE_PATH)
if not packed_scene or not packed_scene is PackedScene:
push_error("Failed to load Game scene at: %s" % GAME_SCENE_PATH)
return
get_tree().change_scene_to_packed(packed_scene)
func save_game() -> void:
print("Game saved (mock)")
func exit_to_main_menu() -> void:
var packed_scene := load(MAIN_SCENE_PATH)
if not packed_scene or not packed_scene is PackedScene:
push_error("Failed to load Main scene at: %s" % MAIN_SCENE_PATH)
return
get_tree().change_scene_to_packed(packed_scene)