Drive planets from definitions

This commit is contained in:
Loïc Wisniewski 2026-08-14 16:13:24 +02:00
commit 02643c76c4
22 changed files with 183 additions and 82 deletions

View file

@ -1,6 +1,7 @@
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
@ -22,7 +23,8 @@ var transitioning: bool = false
func _ready() -> void:
_compose_surface(SURFACE_PROFILES.get_profile(GameState.surface_profile_id))
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)
camera.position = Vector2.ZERO
camera.zoom = Vector2(GameState.return_camera_zoom, GameState.return_camera_zoom)