Add timed craft queue and hangar

This commit is contained in:
Loïc Wisniewski 2026-08-12 22:47:46 +02:00
commit 82552464d2
14 changed files with 660 additions and 191 deletions

View file

@ -128,9 +128,6 @@ func move_in_direction(direction: Vector2) -> void:
func _process(delta: float) -> void:
# Before the steering early-out: a ship the crafter has already built and
# paid for is owed whether or not the fleet happens to be flying (#16).
_claim_owed_ships()
if steer_direction == Vector2.ZERO:
return
# The anchor - the fleet's formation centre - travels at cruise_speed.
@ -140,17 +137,6 @@ func _process(delta: float) -> void:
_assign_slot_targets()
func _claim_owed_ships() -> void:
# Production completes in the GameState autoload, which may well happen
# while the player is on a planet's surface with no Fleet node in
# existence to hand a vessel to. Those vessels wait in `vessels_owed`
# fleet with room can take them.
while not GameState.vessels_owed.is_empty() and ships.size() < GameState.max_fleet_size():
if not add_ship(String(GameState.vessels_owed[0])):
return
GameState.vessels_owed.pop_front()
func _assign_slot_targets() -> void:
for i in range(ships.size()):
ships[i].set_move_target(fleet_target + formation_offsets[i])