Add a main menu scene (#47)
MainMenu.tscn is now project.godot's entry point: Play / Map Editor (disabled, explains itself - #48 wires it up) / Quit (hidden in web builds), styled like the rest of the game's menus and reusing the starfield shader for its background. Play calls GameState.reset_new_game(), so a second playthrough in the same process starts fresh instead of inheriting whatever the previous run left in the autoload - existing tests still load Main.tscn directly and are unaffected. Part of the #40 conquest-mechanic breakdown.
This commit is contained in:
parent
f14ee656ea
commit
a1fb239a50
7 changed files with 297 additions and 1 deletions
27
GameState.gd
27
GameState.gd
|
|
@ -344,6 +344,33 @@ func reset_progression() -> void:
|
|||
vessel_levels.clear()
|
||||
|
||||
|
||||
# Called from the main menu's Play button (#47): the autoload survives
|
||||
# change_scene_to_file(), so without this a second playthrough in the same
|
||||
# process would start from wherever the last one left off instead of a
|
||||
# fresh game.
|
||||
func reset_new_game() -> void:
|
||||
has_return_position = false
|
||||
surviving_ship_count = BASE_FLEET_SIZE
|
||||
surviving_vessel_types = PackedStringArray()
|
||||
return_world_position = Vector2.ZERO
|
||||
return_camera_zoom = 1.0
|
||||
planet_name = ""
|
||||
planet_id = ""
|
||||
planet_definition_id = "rocky"
|
||||
explored_chunks.clear()
|
||||
bank_inventory = INVENTORY.new({RESOURCE_ORE: 500})
|
||||
fleet_inventory = INVENTORY.new()
|
||||
buildings.clear()
|
||||
next_building_id = 1
|
||||
stored_vessels.clear()
|
||||
vessel_deliveries.clear()
|
||||
extractors.clear()
|
||||
transporters.clear()
|
||||
planet_capture.clear()
|
||||
reset_progression()
|
||||
reset_formation()
|
||||
|
||||
|
||||
# --- building stock and production queue (#16) -----------------------------
|
||||
|
||||
# Since #12, a building cannot just deduct from the bank at the moment of
|
||||
|
|
|
|||
Loading…
Reference in a new issue