Initial commit: SpaceshipTest, a top-down space RTS in Godot 4.7.1
A fleet of neon-outlined ships explores a procedurally generated, seeded
infinite world: tap/joystick steering, pinch zoom, formation pivoting,
planet landings, an ore economy with extractors and haulers, and player
built structures (mothership, ship crafter, command centre).
All art is hand-drawn with draw_* calls rather than textures, and the
backgrounds are camera-relative shaders so they stay precise at large
world coordinates.
Includes a 35-test headless suite (tests/run_tests.sh) plus screenshot
tooling that renders real frames through Xvfb and Mesa softpipe, since
--headless has no GPU.
Excluded from version control: .godot/ (import cache, and it holds
export credentials), builds/, android/build/ and packaged APKs - all
regenerable, and ~325 MB combined.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 18:41:58 +02:00
|
|
|
extends Node2D
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
# fades back out to Main.tscn, restoring the fleet at wherever it left
|
|
|
|
|
# space from.
|
|
|
|
|
|
|
|
|
|
@export var fade_duration: float = 0.4
|
|
|
|
|
|
|
|
|
|
@onready var fleet: Node2D = get_node("../Fleet")
|
|
|
|
|
@onready var camera: Camera2D = get_node("../Camera2D")
|
|
|
|
|
@onready var planet_name_label: Label = get_node("../UI/PlanetNameLabel")
|
|
|
|
|
@onready var exit_button: IconButton = get_node("../UI/ExitButton")
|
|
|
|
|
@onready var fade_rect: ColorRect = get_node("../FadeOverlay/FadeRect")
|
|
|
|
|
|
|
|
|
|
var transitioning: bool = false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
2026-08-13 22:04:21 +02:00
|
|
|
if GameState.planet_type == "gas_giant":
|
|
|
|
|
# A gas giant is not lunar terrain: its surface view uses a deep,
|
2026-08-14 11:54:31 +02:00
|
|
|
# coloured atmosphere instead of the rocky field. The background is
|
|
|
|
|
# shader-driven, so changing ColorRect.color does not tint it; update
|
|
|
|
|
# the actual palette uniforms.
|
2026-08-13 22:04:21 +02:00
|
|
|
get_node("../RockField").visible = false
|
|
|
|
|
get_node("../GasVentField").visible = true
|
2026-08-14 11:54:31 +02:00
|
|
|
var background: ColorRect = get_node("../BackgroundLayer/LunarBackground")
|
|
|
|
|
var atmosphere: ShaderMaterial = background.material
|
|
|
|
|
atmosphere.set_shader_parameter("base_color", Color(0.13, 0.025, 0.22, 1.0))
|
|
|
|
|
atmosphere.set_shader_parameter("crater_color", Color(0.055, 0.008, 0.11, 1.0))
|
|
|
|
|
atmosphere.set_shader_parameter("highlight_color", Color(0.52, 0.17, 0.7, 1.0))
|
|
|
|
|
# The lunar surface uses dark captions on a bright ground. Flip only
|
|
|
|
|
# those captions for the night-dark gas atmosphere.
|
|
|
|
|
for caption_path in ["../UI/BankCaption", "../UI/FleetCaption"]:
|
|
|
|
|
var caption: Label = get_node(caption_path)
|
|
|
|
|
caption.add_theme_color_override("font_color", Color(0.78, 0.88, 0.94))
|
|
|
|
|
caption.add_theme_color_override("font_outline_color", Color(0.02, 0.01, 0.05, 0.9))
|
Initial commit: SpaceshipTest, a top-down space RTS in Godot 4.7.1
A fleet of neon-outlined ships explores a procedurally generated, seeded
infinite world: tap/joystick steering, pinch zoom, formation pivoting,
planet landings, an ore economy with extractors and haulers, and player
built structures (mothership, ship crafter, command centre).
All art is hand-drawn with draw_* calls rather than textures, and the
backgrounds are camera-relative shaders so they stay precise at large
world coordinates.
Includes a 35-test headless suite (tests/run_tests.sh) plus screenshot
tooling that renders real frames through Xvfb and Mesa softpipe, since
--headless has no GPU.
Excluded from version control: .godot/ (import cache, and it holds
export credentials), builds/, android/build/ and packaged APKs - all
regenerable, and ~325 MB combined.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 18:41:58 +02:00
|
|
|
fleet.spawn_ships(GameState.surviving_ship_count, Vector2.ZERO)
|
|
|
|
|
camera.position = Vector2.ZERO
|
|
|
|
|
camera.zoom = Vector2(GameState.return_camera_zoom, GameState.return_camera_zoom)
|
|
|
|
|
planet_name_label.text = GameState.planet_name
|
|
|
|
|
exit_button.pressed.connect(_on_exit_pressed)
|
|
|
|
|
|
|
|
|
|
fade_rect.color.a = 1.0
|
|
|
|
|
var tween: Tween = create_tween()
|
|
|
|
|
tween.tween_property(fade_rect, "color:a", 0.0, fade_duration)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _on_exit_pressed() -> void:
|
|
|
|
|
if transitioning:
|
|
|
|
|
return
|
|
|
|
|
transitioning = true
|
|
|
|
|
|
|
|
|
|
GameState.surviving_ship_count = fleet.ships.size()
|
|
|
|
|
|
|
|
|
|
var tween: Tween = create_tween()
|
|
|
|
|
tween.tween_property(fade_rect, "color:a", 1.0, fade_duration)
|
|
|
|
|
tween.tween_callback(_return_to_space)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _return_to_space() -> void:
|
|
|
|
|
get_tree().change_scene_to_file("res://Main.tscn")
|