fix(game): restore the original plunger launch

Start each ball at the recovered right-lane coordinates and charge the
plunger while Down is held, firing only on release. Render all eleven frames
of resource 901, preserve object 25 as the returning-ball catch, and use the
object table's center-contact extents without adding the art radius twice.

Test Plan:
- cargo fmt --all -- --check
- cargo test
- cargo clippy --all-targets --all-features -- -D warnings
- runtime smoke: start, hold Down, release, and inspect the right shooter lane
This commit is contained in:
2026-08-22 17:37:28 +02:00
parent f904977ae4
commit 91ae8cdfd8
6 changed files with 169 additions and 51 deletions
+11 -13
View File
@@ -136,14 +136,9 @@ impl App {
self.assets.play(2012, self.saved.settings.sounds);
}
if is_key_pressed(KeyCode::Down) || is_key_pressed(KeyCode::Enter) {
let mut game = Game::new(self.player_count);
let launched = game.launch();
self.game = Some(game);
self.game = Some(Game::new(self.player_count));
self.screen = Screen::Playing;
self.assets.play(2008, self.saved.settings.sounds);
if launched {
self.assets.play(2016, self.saved.settings.sounds);
}
}
}
@@ -175,7 +170,7 @@ impl App {
let controls = Controls {
left_flipper,
right_flipper,
launch_pressed: is_key_pressed(KeyCode::Down),
launch_down: is_key_down(KeyCode::Down),
nudge,
};
let events = self.game.as_mut().map_or_else(Vec::new, |game| {
@@ -486,15 +481,18 @@ impl App {
YELLOW,
);
}
let frame = animation_frame(get_time(), 18.0, 10);
}
if game.ball.in_launcher {
let frame = [0.05, 0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85, 0.95]
.partition_point(|threshold| game.launcher_charge >= *threshold);
draw_texture_ex(
&self.assets.magnet,
306.0,
411.0,
&self.assets.plunger,
314.0,
406.0,
WHITE,
DrawTextureParams {
dest_size: Some(vec2(23.0, 17.0)),
source: Some(Rect::new(frame as f32 * 23.0, 0.0, 23.0, 17.0)),
dest_size: Some(vec2(21.0, 18.0)),
source: Some(Rect::new(frame as f32 * 21.0, 0.0, 20.0, 17.0)),
..Default::default()
},
);