fix(game): restore the original claw sequence
Replace the broad robot bounce rectangle with the recovered object-89 capture state machine. Suspend the live ball, advance the exact sprite rows, release from decoded original coordinates and directions, and keep the surrounding collision records disabled until the arm returns home. Render the 900x296 sheet as 100x74 frames at the original destination and suppress the duplicate ball while it is embedded in the capture animation. Test Plan: - cargo fmt --check - cargo test - cargo clippy --all-targets --all-features -- -D warnings - git diff --cached --check
This commit is contained in:
+21
-21
@@ -383,21 +383,6 @@ impl App {
|
||||
},
|
||||
);
|
||||
}
|
||||
if game.robot_animation > 0.0 {
|
||||
let frame = animation_frame(f64::from(1.0 - game.robot_animation), 14.0, 10);
|
||||
draw_texture_ex(
|
||||
&self.assets.robot,
|
||||
238.0,
|
||||
31.0,
|
||||
WHITE,
|
||||
DrawTextureParams {
|
||||
dest_size: Some(vec2(90.0, 74.0)),
|
||||
source: Some(Rect::new(frame as f32 * 90.0, 0.0, 90.0, 74.0)),
|
||||
..Default::default()
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
for (index, bumper) in BUMPERS.into_iter().enumerate() {
|
||||
if game.bumper_flash[index] > 0.0 {
|
||||
draw_circle_lines(bumper.center.x, bumper.center.y, 17.0, 3.0, WHITE);
|
||||
@@ -466,12 +451,27 @@ impl App {
|
||||
);
|
||||
}
|
||||
}
|
||||
draw_texture(
|
||||
&self.assets.ball,
|
||||
game.ball.position.x - 8.0,
|
||||
game.ball.position.y - 8.0,
|
||||
WHITE,
|
||||
);
|
||||
if !game.claw.ball_suspended {
|
||||
draw_texture(
|
||||
&self.assets.ball,
|
||||
game.ball.position.x - 8.0,
|
||||
game.ball.position.y - 8.0,
|
||||
WHITE,
|
||||
);
|
||||
}
|
||||
if let Some(source) = game.claw.sprite_source() {
|
||||
draw_texture_ex(
|
||||
&self.assets.robot,
|
||||
238.0,
|
||||
47.0,
|
||||
WHITE,
|
||||
DrawTextureParams {
|
||||
dest_size: Some(vec2(100.0, 74.0)),
|
||||
source: Some(source),
|
||||
..Default::default()
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
self.draw_displays(game);
|
||||
if game.tilted {
|
||||
|
||||
Reference in New Issue
Block a user