Refine context actions and preserve fleet landings

This commit is contained in:
Loïc Wisniewski 2026-08-14 23:15:12 +02:00
commit 663648d949
20 changed files with 197 additions and 103 deletions

View file

@ -3,9 +3,9 @@ extends Node2D
const SURFACE_PROFILES = preload("res://PlanetSurfaceProfiles.gd")
const PLANET_DEFINITIONS = preload("res://PlanetDefinitions.gd")
# Bootstraps the surviving fleet on this scene's own startup (from
# GameState, since this is a fresh scene tree - nothing here carries
# over automatically) and handles the always-available exit prompt that
# Bootstraps the surviving fleet, including each vessel type, on this scene's
# own startup (from GameState, since this is a fresh scene tree - nothing here
# carries over automatically) and handles the always-available exit prompt that
# fades back out to Main.tscn, restoring the fleet at wherever it left
# space from.
@ -25,7 +25,8 @@ var transitioning: bool = false
func _ready() -> void:
var planet_definition: Resource = PLANET_DEFINITIONS.get_definition(GameState.planet_definition_id)
_compose_surface(SURFACE_PROFILES.get_profile(planet_definition.surface_profile_id))
fleet.spawn_ships(GameState.surviving_ship_count, Vector2.ZERO)
fleet.spawn_ships(GameState.surviving_ship_count, Vector2.ZERO,
GameState.surviving_vessel_types)
camera.position = Vector2.ZERO
camera.zoom = Vector2(GameState.return_camera_zoom, GameState.return_camera_zoom)
planet_name_label.text = GameState.planet_name
@ -57,6 +58,7 @@ func _on_exit_pressed() -> void:
transitioning = true
GameState.surviving_ship_count = fleet.ships.size()
GameState.surviving_vessel_types = fleet.vessel_types()
var tween: Tween = create_tween()
tween.tween_property(fade_rect, "color:a", 1.0, fade_duration)