character update instructions week 3
This commit is contained in:
parent
7e4fd00267
commit
32a2fc789e
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user