fix(game): restore one-shot magnetic fields
Replace the global timed magnet and drain teleport with the three recovered field records. Map top targets 150-152 to center field 6 and outlane fields 153-154, apply upward pull only inside each registered rectangle, and deactivate the field after it pulls the ball through its upper boundary. Render each active field from its exact original active-table rectangle instead of drawing invented yellow triangles. Test Plan: - `cargo test --all-targets` -- 48 passed - `cargo clippy --all-targets -- -D warnings` -- passed - production build plus Windows GNU and macOS checks -- passed - live field-153 entry direction matched and Rust field lifecycle test passed - `git diff --cached --check` -- passed
This commit is contained in:
+16
-13
@@ -410,19 +410,22 @@ impl App {
|
||||
let index = usize::from(game.player().diamond_segments.min(9) - 1);
|
||||
draw_texture(&self.assets.diamond[index], 123.0, 298.0, WHITE);
|
||||
}
|
||||
if game.magnets > 0.0 {
|
||||
for x in [18.0, 296.0] {
|
||||
draw_triangle(
|
||||
vec2(x, 345.0),
|
||||
vec2(x - 7.0, 359.0),
|
||||
vec2(x + 7.0, 359.0),
|
||||
YELLOW,
|
||||
);
|
||||
draw_triangle(
|
||||
vec2(x, 367.0),
|
||||
vec2(x - 7.0, 381.0),
|
||||
vec2(x + 7.0, 381.0),
|
||||
YELLOW,
|
||||
for (object_id, region) in [
|
||||
(6, Rect::new(151.0, 389.0, 13.0, 49.0)),
|
||||
(153, Rect::new(11.0, 344.0, 13.0, 49.0)),
|
||||
(154, Rect::new(291.0, 346.0, 13.0, 49.0)),
|
||||
] {
|
||||
if game.magnetic_field_active(object_id) {
|
||||
draw_texture_ex(
|
||||
&self.assets.active_table,
|
||||
region.x,
|
||||
region.y,
|
||||
WHITE,
|
||||
DrawTextureParams {
|
||||
dest_size: Some(vec2(region.w, region.h)),
|
||||
source: Some(region),
|
||||
..Default::default()
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user