Skip to content

Commit

Permalink
clear aimline when too low
Browse files Browse the repository at this point in the history
  • Loading branch information
OmmyZhang committed Feb 18, 2024
1 parent 41697c1 commit ce9910c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,10 +522,11 @@ pub fn game(props: &Props) -> Html {
);

let (dx, dy) = (x - ox, y - oy);
if dy > -2.0 * BALL_R * ratio {
return;
}
if let Ok(mut ms) = map_status.try_borrow_mut() {
if dy > -2.0 * BALL_R * ratio {
ms.draw_basic(true);
return;
}
ms.vx = dx / dx.hypot(dy);
ms.vy = dy / dx.hypot(dy);

Expand Down

0 comments on commit ce9910c

Please sign in to comment.