Repository navigation
Phase 5: Zylons, photons, shields, meteors and explosions (MANUAL_SPEC §16, §17.7, §17.8, §18.3) - #8
Merged
spacehunter merged 2 commits intoNov 28, 2026
Conversation
…/meteor(), tests (MANUAL_SPEC §16, §17.7, §17.8, §18.3)
spacehunter
deleted the
h/star-raiders-phase-5-zylons-photons-shie-iyvb
branch
November 28, 2026 02:22
spacehunter
restored the
h/star-raiders-phase-5-zylons-photons-shie-iyvb
branch
November 28, 2026 02:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 5 of docs/OVERHAUL_PLAN.md Part 3. The rules come from MANUAL_SPEC §16, §17.7, §17.8, §17.13 and §18.3. Where the spec leaves a detail open, the ROM routine it cites decides it: MANEUVER, TRIGGER, COLLISION, INITEXPL, INITPOSVEC, GAMELOOP steps 8–15 and 26–27, and the tables ZYLONSHAPTAB, ZYLONFLPATTAB, ZYLONVELTAB, ZYLONHOMVELTAB, HITMIN/MAXZTAB, PLSHAP1/2TAB, PLSHAPOFF/HEIGHT/COLOR/BRITTAB.
What changed
src/sim/zylons.ts(§17.7, §17.8). It simulates the ROM's five PLAYER objects plus the explosion, in KM in the ship frame:src/render/sprites.ts, §17.13, §18.3):entities/Enemy.ts,entities/EnemyProjectile.ts,entities/PhotonTorpedo.ts,systems/CombatSystem.ts,config/EnemyConfig.ts. Callers are switched: Game, the long-range scan (now ±40,000 KM), θΦR tracking, and M as the target toggle.__sr.spawnnow takes KM. A placed ship flies straight in.__sr.zylons()and__sr.meteor(x,y,z).11-fighter-approach,11a-fighter-hit,11b-explosion,12-meteor,12a-meteor-shot,13-fighter,13a-cruiser,13b-basestar, plus the--sequence fighter-killGIF.Checks
npm run buildpasses.npm test: 187 tests pass (42 new). They cover the basestar rule, shields-down death, the 23-loop refire, the type mix, the meteor rules, the 2-ship/1-torpedo limits, homing by level, back attacks, explosions, the sprite bitmaps, size cells and the basestar flicker.npm run capture -- --seed 1979run plays to mission end (zero energy) in 29 shots. Two runs gave identical hashes, with no page errors.Calls I made where the spec is silent or loose
Evidence
Seeded NOVICE run (seed 1979, capture --sequence fighter-kill): a fighter's grey H approaches, two photons leave the alternating barrels, the hit, then the 32-fragment explosion. The fighter's own torpedo then hits the raised shields (random-colour flash, −100 energy). Left: the full frame; right: 2× zoom of the centre.
Fighter, cruiser and basestar: the manual's sprite plates, the in-game sprite at cell 0 (capture shots 13, 13a, 13b), and all 8 ROM shape cells with grey brightness by range ($0E near, $04 far). The basestar's colour flickers at random each frame.
Meteor shot down (capture shots 12 and 12a): a green meteor comes in at −8 KM/loop plus our speed, a photon hits it, it explodes into 32 fragments, and K stays at 19 because meteors score nothing.
Contact sheet of the seed-1979 capture: 29 shots running to mission end (09-zero-energy), including the new Phase 5 shots 11–13b. Two runs gave identical hashes.