fix(game): restore startup and multiball edge behavior
Build TDK Pinball / build (macos-latest) (push) Canceled after 0s
Build TDK Pinball / build (ubuntu-latest) (push) Canceled after 0s
Build TDK Pinball / build (windows-latest) (push) Canceled after 0s
Build TDK Pinball / build (macos-latest) (push) Canceled after 0s
Build TDK Pinball / build (ubuntu-latest) (push) Canceled after 0s
Build TDK Pinball / build (windows-latest) (push) Canceled after 0s
The interactive build inherited Macroquad's fixed zero random state, making maximum-power launcher shots repeat across fresh runs. Seed the platform generator from the startup clock before taking the program-global gameplay seed. Require record 148's still-live contact before the effect-seven special respawn and clear active multiball state on an ordinary ball drain, so a released reserve ball cannot be recreated after both slots are lost. Type-4 target and effect handlers now honor each record's predicted broadphase before changing its entry latch. This preserves the latch while another multiball slot is elsewhere, preventing repeated upper-left corridor scoring. The regressions and regenerated browser artifact stay with the implementation. Test Plan: - `just test` -- passed (137 tests) - `just clippy` -- passed - `cargo build --profile production` -- passed - `just web-build` -- passed - `cargo +nightly fmt --check` -- passed - `rumdl check --flavor commonmark CHANGELOG.md` -- passed - `git diff --cached --check` -- passed
This commit is contained in:
@@ -94,6 +94,13 @@ fn add_player_released() -> bool {
|
||||
ADD_PLAYER_KEYS.into_iter().any(is_key_released)
|
||||
}
|
||||
|
||||
fn initial_game_random_seed() -> u32 {
|
||||
// The original seeds RandSeed from the startup clock. Macroquad's random
|
||||
// generator starts from a fixed zero state unless the application seeds it.
|
||||
macroquad::rand::srand(macroquad::miniquad::date::now().to_bits());
|
||||
macroquad::rand::rand()
|
||||
}
|
||||
|
||||
fn visible_score_digits(mut value: u32) -> Vec<(u8, u8)> {
|
||||
let mut digits = Vec::with_capacity(8);
|
||||
for position in 0..8 {
|
||||
@@ -236,7 +243,7 @@ impl App {
|
||||
screen: Screen::Loading,
|
||||
return_screen: Screen::Attract,
|
||||
game: None,
|
||||
game_random_seed: macroquad::rand::rand(),
|
||||
game_random_seed: initial_game_random_seed(),
|
||||
setting_row: 0,
|
||||
loading_started,
|
||||
loading_until: loading_started + 1.1,
|
||||
|
||||
Reference in New Issue
Block a user