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
|
|
|
|
|
|
|
|
|
|
# Preview scene for eyeballing building art - NOT run by run_tests.sh
|
|
|
|
|
# (underscore prefix). Lays out the mothership and command centre alongside
|
|
|
|
|
# several phases of the ship crafter's assembly cycle, with the crafter's
|
|
|
|
|
# _process disabled and anim_time pinned, so a single softpipe render shows
|
|
|
|
|
# the whole animation at once (the renderer is far too slow here to time a
|
|
|
|
|
# live frame).
|
|
|
|
|
#
|
|
|
|
|
# bash tests/screenshot.sh res://tests/_crafter_preview.tscn /tmp/out.png 20
|
|
|
|
|
|
|
|
|
|
# Each cell is either a building type (drawn once) or a crafter phase.
|
|
|
|
|
const CELLS: Array = [
|
|
|
|
|
{"type": "mothership"},
|
|
|
|
|
{"type": "command_center"},
|
|
|
|
|
{"type": "mothership"},
|
|
|
|
|
{"phase": 0.10},
|
|
|
|
|
{"phase": 0.35},
|
|
|
|
|
{"phase": 0.60},
|
|
|
|
|
{"phase": 0.88},
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
|
RenderingServer.set_default_clear_color(Color(0.02, 0.03, 0.06))
|
|
|
|
|
var building_scene: PackedScene = load("res://Building.tscn")
|
|
|
|
|
for i in range(CELLS.size()):
|
|
|
|
|
var cell: Dictionary = CELLS[i]
|
|
|
|
|
var b: Node2D = building_scene.instantiate()
|
|
|
|
|
b.building_type = cell.get("type", GameState.BUILDING_SHIP_CRAFTER)
|
|
|
|
|
b.position = Vector2(-240.0 + float(i % 3) * 240.0, -105.0 + float(i / 3) * 215.0)
|
|
|
|
|
add_child(b)
|
|
|
|
|
if cell.has("phase"):
|
2026-08-14 21:44:28 +02:00
|
|
|
b.visual.set_process(false)
|
|
|
|
|
b.visual.anim_time = float(cell.phase) * b.visual.CYCLE
|
|
|
|
|
b.visual.apply_animation()
|
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
|
|
|
|
|
|
|
|
var cam: Camera2D = Camera2D.new()
|
|
|
|
|
cam.zoom = Vector2(1.65, 1.65)
|
|
|
|
|
add_child(cam)
|
|
|
|
|
cam.make_current()
|