Skip to content

Commit 25381f8

Browse files
Added terminal velocity hahahahah
1 parent d644554 commit 25381f8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/game/playing/physics/cube.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ pub fn physics_handle(
88
on_ground: &mut bool,
99
jump_force: f32
1010
) {
11-
velocity_y.set(velocity_y.get() + gravity);
11+
if velocity_y.get() < 20.0
12+
&& velocity_y.get() > -20.0 {
13+
velocity_y.set(velocity_y.get() + gravity);
14+
}
1215

1316
if (is_mouse_button_down(MouseButton::Left) || is_key_down(KeyCode::Space) || is_key_down(KeyCode::Up)) && *on_ground {
1417
velocity_y.set(velocity_y.get() - jump_force);

0 commit comments

Comments
 (0)