Capture points and the planet conquest loop #43
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #40. Depends on the conquest-state ticket and the planet-setups ticket.
Several points on the surface must be held for some time with no enemies around; once all are captured the planet is conquered and an extractor becomes buildable.
Scope
CapturePoint.tscn+CapturePoint.gd(Area2D):@export var point_index: int(its index within the setup - this is whatGameStatekeys on)@export var capture_radius: float = 220.0@export var capture_time: float = 8.0@export var enemy_clear_radius: float = 700.0@export var drain_rate: float = 0.5(fraction of fill rate)neutral/blocked/capturing/captured.player_shipsis withincapture_radiusand no live node in groupenemiesis withinenemy_clear_radius. Otherwise it drains atdrain_rate- a hard reset is too punishing to read on a phone.captured, permanent for the run, callsGameState.mark_point_captured(GameState.planet_id, point_index).NeonDrawidiom -GasBombController._draw_ringis the reference for ring rendering, andVesselGasBomberComponent's hull fill is the reference for "fills up as it progresses". Distinct colours per state soblocked(enemies nearby) is obvious without text.PlanetSetupHost(from the setups ticket) instantiates oneCapturePointpersetup.capture_pointsentry with its index, callsGameState.register_capture_points(planet_id, count), and marks already-captured indices ascapturedimmediately so re-landing on a partly taken planet restores progress.HUD on
PlanetSurface.tscn'sUICanvasLayer, nearPlanetNameLabeland styled the same:"CAPTURED 2/3", or"CONQUERED"once done. It must update live as points complete.On the final point, a brief on-screen confirmation (a label fade is enough - no new modal).
Out of scope
New enemy types (the enemy tickets), the world map showing conquered planets.
Acceptance criteria
capture_timeseconds, andGameState.captured_point_countreflects it.enemiesinsideenemy_clear_radius, progress does not increase.capture_radiusdrains progress gradually; it does not drop to zero instantly, and an already-captured point never reverts.GameState.is_planet_conquered(planet_id)true, and back in space the extractor option over that planet is enabled.Tests
tests/test_capture_points.gd(bash tests/run_tests.sh capture), plus a 720x1280 screenshot ofres://PlanetSurface.tscnconfirming the ring, its progress arc and the HUD count read clearly at phone size.Repo notes (read before starting)
/storage/emulated/0/GodotProjects/SpaceshipTest.touchon it. Android FUSE does not bump mtime under~/storage/shared, and Godot's import cache will silently keep serving the old version, making a correct fix look like it did nothing.bash tests/run_tests.sh <substring>; full suite with no argument. Tests areSceneTreescripts printingTEST_NAME: PASS/TEST_NAME: FAIL (reason)and callingquit(0|1)- copy the shape oftests/test_gas_bomber_cooldowns.gd.bash tests/screenshot.sh <res://Scene.tscn> <out.png> <frames> 720x1280. Use few frames (~10-20); the software rasterizer is slow.--headlessrenders nothing at all, so it cannot validate visuals.NeonDraw/NeonPiece; do not introduce a different visual idiom.*Definitionresources plus capability component scenes. Do not addif type == "..."branches.FileAccess, nouser://anywhere outside this ticket's explicit scope).GameStateis an in-memory autoload. Do not invent a save system.Implemented and pushed as
c4e2ee7.CapturePointtracks neutral/blocked/capturing/captured by polling proximity each frame (a ship incapture_radius, no enemy withinenemy_clear_radius), draining gradually rather than resetting on interruption, and callingGameState.mark_point_captured()on completion.PlanetSetupHostnow instantiates the realCapturePointscene per authored point - restoring already-captured state immediately on re-landing - and spawns each setup's authored enemies, replacing #42's placeholder markers through the sameapply_setup()seam.CaptureLabelis a small self-polling HUD (same convention asResourceCounter) showing "CAPTURED n/m" or "CONQUERED" with a one-shot fade, themed per surface profile.New test
tests/test_capture_points.gdcovers restoration-on-relanding, fill-to-capture timing, enemy-blocking without erasing progress, gradual (not instant) drain, and the GameState flags BuildController's extractor gate already reads. Verified visually at 720x1280 - distinct rings per state (neutral/blocked/capturing/captured), each with the capture-radius ring plus a filling progress beacon.Caught one real regression along the way:
test_planet_atmosphere_transition.gdassumed a landed surface never has enemies, which authored guard enemies now legitimately violate. Narrowed that check to what it actually needs to prove - no space-sideEnemySpawner/AsteroidFieldnode leaks across the scene swap - rather than "zero enemies ever."#45/#46 build the enemy types these points can now be guarded by.