Add spacecraft exit sequence at level exit zones

Spawn an exit ship when the player approaches an exit zone. The ship
flies in, lands near the exit, and waits for the player to board.
On boarding the player is deactivated, the ship takes off, and the
level transition fires after departure.
This commit is contained in:
Thomas
2026-03-01 12:38:41 +00:00
parent 98d2e87bb3
commit ded662b42a
5 changed files with 232 additions and 30 deletions

31
TODO.md
View File

@@ -21,10 +21,12 @@ sizes. Key areas to check:
- Camera bounds and coordinate overflow (float precision at large coords)
- Level file parsing (row lines could exceed fgets buffer at 5000+ columns)
## Spacecraft at level exit
Ship landing at exit zone when player approaches — player enters, ship takes
off, triggers level transition. The intro/start sequence is done; this is the
exit counterpart.
## ~~Spacecraft at level exit~~ ✓
Implemented: `spacecraft_spawn_exit()` with `is_exit_ship` flag. Proximity
trigger in `level.c` spawns exit ship when player is within ~2 screen widths
of an exit zone. Ship flies in, lands near exit. Player overlaps landed ship →
player deactivated, ship takes off, camera holds still, level transition fires
after ship departs (SC_DONE).
## ~~Asteroid refinement~~ ✓
Implemented: base speed 120→200, accel 200→350, respawn 3→6s, stagger 0-3→0-8s,
@@ -43,6 +45,27 @@ Extend the moon into a 3-level sequence connected by spacecraft takeoff/landing:
- Moon exit transitions require the "spacecraft at level exit" feature so
the ship flies in when the player approaches the exit zone.
## Level generator: height zones (verticality)
Add vertical variety to generated levels using a "height zones" approach:
- Double tilemap height from 23 to ~46 tiles (two screens tall)
- Define two elevation bands: HIGH (ground ~row 17) and LOW (ground ~row 40)
- Existing segment generators get a `y_offset` parameter so internal logic
barely changes — platforms, enemies, corridors all shift by offset
- New vertical connector segments (ramps/climbs) bridge between zones
- Theme decides zone usage: Surface stays LOW, Station uses both, Base uses HIGH
- Camera needs vertical look-ahead when player has vertical velocity
### Implementation steps
1. Add vertical camera look-ahead (small Y lead when player moves vertically)
2. Create a handcrafted tall test level (~40x46) to validate camera, physics,
rendering, and entities all work with vertical scrolling
3. Refactor `set_tile()` / `fill_ground()` to accept a height parameter instead
of hardcoded `SEG_HEIGHT`
4. Add `y_offset` parameter to all segment generators
5. Add `SEG_CLIMB` connector segment type (shaft/platforms between zones)
6. Update `levelgen_generate()` to assign zones per segment and insert climbs
7. The station generator stays at 23 tiles (corridor envelope already constrains)
## Jetpack boost blue flame effects
- Add continuous blue flame particles trailing from the player during jetpack
boost (while boost is active, not just on burst)