Commit graph spaceship/Planet.gd
Author SHA1 Message Date
Loïc Wisniewski
02643c76c4 Drive planets from definitions 2026-08-14 16:13:24 +02:00
Loïc Wisniewski
2f68515f33 Compose planet surfaces from profiles 2026-08-14 16:05:32 +02:00
Loïc Wisniewski
fc68c4e8cf Add gas giant resource system 2026-08-13 21:07:35 +02:00
Loïc Wisniewski
2eb779e5de Show the extractor derrick the moment it is built, not on respawn
Follow-up to #9: the marker was resolved once in Planet._ready() on the
assumption that extractors are built on PlanetSurface.tscn, so a Planet
node could never outlive a change to its own answer. That assumption was
wrong. Extractors are built from SPACE, via
BuildController._planet_under_fleet() with the fleet parked on the
planet, so the Planet node is already in the tree with _ready() long
since run. The derrick therefore did not appear until the planet
happened to despawn and respawn - building one read as doing nothing.

GameState now emits extractor_added, and Planet keeps its marker in step
with it, redrawing only when its own answer actually changes.

The test missed this because it spawned a fresh planet after registering
the extractor, which is not the order the game does it in. It now keeps
a planet alive across the build and asserts the derrick appears on that
node.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 15:43:43 +02:00
Loïc Wisniewski
8dd5d7b78f Show buildings on the world map, and extractors on their planets
Forgejo #11: buildings the player has placed now appear on the world
map. They are placed freely in space rather than tied to a chunk, so
they get their own pass in WorldMapContent._draw() rather than riding
along with the chunk markers. Each type has its own shape and colour,
mirroring Building.gd's constants so a marker reads as the same
building you built.

Forgejo #9: a planet with an extractor built on it now shows it, in
both places you look at a planet - an amber derrick on its outline in
space, and a matching badge on its world-map marker. The extractor
lives on PlanetSurface.tscn, a scene you are not looking at from
space, so an already-mined planet was otherwise indistinguishable
from an untouched one until you landed on it.

The positioning steps are factored out (building_markers(),
chunk_has_extractor_badge(), extractor_derrick_tip()) so headless
tests can assert on them - --headless has no GPU and draws no pixels,
so there is nothing to check in _draw() itself. Both features were
also rendered for real via tests/screenshot.sh and looked at.

extractor_derrick_tip() exists because the first version of the
"derrick is not buried inside the planet" check measured the furthest
of all four derrick points, which passes a derrick pointing straight
into the ground: the base corners sit a half-width off the rim vertex
and clear the outline on their own. Mutation-testing caught it.

screenshot.sh now clears a stale /tmp/.X99-lock. A run killed
mid-screenshot leaves it behind and Xvfb then refuses :99, which
resurfaces later as Godot's misleading "X11 Display is not available".

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 15:29:56 +02:00
Loïc Wisniewski
85814ce88c 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