character update instructions week 3

This commit is contained in:
OddlyTimbot 2025-09-29 16:31:36 -04:00
parent 7e4fd00267
commit 32a2fc789e

View File

@ -106,12 +106,13 @@ Note the addition of the state change to `State.JUMP`. That is the main thing we
if current_state == State.JUMP:
#apply normal velocity
velocity += get_gravity() * delta
else:
#apply hard gravity, character falling
velocity += get_gravity() * hard_gravity * delta
if velocity.y>0:
current_state = State.FALLING
else:
#apply hard gravity, character falling
velocity += get_gravity() * hard_gravity * delta
if velocity.y>0:
current_state = State.FALLING
```
Now if the player is in the "JUMP" state they get normal gravity, otherwise they get the hard gravity.