Skip to content

Commit d644554

Browse files
Fixed the ball
I feel like the physics actually feels better than in the old client
1 parent 517a12c commit d644554

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/game/playing/physics/ball.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ pub fn physics_handle(
1010
) {
1111
velocity_y.set(velocity_y.get() + gravity.get());
1212

13-
if *on_ground && (is_mouse_button_down(MouseButton::Left) || is_key_down(KeyCode::Space) || is_key_down(KeyCode::Up)) {
13+
if *on_ground && (is_mouse_button_pressed(MouseButton::Left) || is_key_pressed(KeyCode::Space) || is_key_pressed(KeyCode::Up)) {
1414
gravity.set(-gravity.get());
1515
*player_y = if gravity.get() > 0.0 { *player_y + 1.0 } else { *player_y - 1.0 };
16+
velocity_y.set(if gravity.get() > 0.0 { 5.0 } else { -5.0 });
1617
*on_ground = false;
1718
}
1819
}

0 commit comments

Comments
 (0)