diff --git a/week3/character_update.md b/week3/character_update.md index a131431..09dc452 100644 --- a/week3/character_update.md +++ b/week3/character_update.md @@ -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.