fix(random): continue Borland seed across games

The original RandSeed is program-global and is initialized once at startup.
Rust stored the exact Borland generator inside Game but discarded its final
state at game over and seeded every following game from Macroquad again,
breaking stream continuity across high-score/attract flow.

Expose the current seed, retain it when the App consumes a finished game, and
construct the next game from that value. Attract, high-score, and portable UI
continue to consume no gameplay draws.

Test Plan:
- `cargo test --workspace --all-targets --all-features` -- 125 passed
- `cargo clippy --workspace --all-targets --all-features -- -D warnings` -- passed
- `rumdl check --flavor commonmark RECONSTRUCTION.md CHANGELOG.md` -- passed
- `git diff --cached --check` -- passed
This commit is contained in:
2026-08-23 20:43:10 +02:00
parent 2a17fbeeef
commit db0ec0bdc4
5 changed files with 18 additions and 5 deletions
+2
View File
@@ -189,6 +189,8 @@ and this project adheres to
- Replace the Xorshift gameplay RNG with the original Borland linear stream and
unbiased `Random(n)` high-word mapping. Launcher variation, effect selection,
claw terminals, and magnetic-field impulses now share the recovered sequence.
- Preserve the Borland seed across game-over/high-score flow so a new game
continues the program-global random stream instead of reseeding per game.
- Restore the magnetic-field response as `vx * 0.9` and a randomized
`-3800 * (1 - Random * 0.3)` vertical impulse instead of a fixed upward speed.
- Dispatch the original per-call-site sound sequences instead of assigning one