This commit is contained in:
bee
2026-07-13 07:38:54 +02:00
parent 90bae5f3e5
commit 9a25448a38
14 changed files with 169 additions and 7 deletions
+22
View File
@@ -0,0 +1,22 @@
# scripts/game_state.gd — autoloaded as "GameState"
extends Node
const HUB_SCENE := "res://hub.tscn"
# Written by the hub before starting a mission, read by the mission in _ready().
# Later this becomes a MissionDef reference; a Dictionary is the v1 stand-in.
var mission_params: Dictionary = {}
# Written by the mission before returning, read by the hub.
var last_mission_result: Dictionary = {}
func start_mission(scene_path: String, params: Dictionary = {}) -> void:
mission_params = params
last_mission_result = {}
get_tree().change_scene_to_file(scene_path)
func return_to_hub(result: Dictionary = {}) -> void:
last_mission_result = result
mission_params = {}
get_tree().change_scene_to_file(HUB_SCENE)