Closed plexsoup closed 5 years ago
I already pass velocity around with quite a few (most) states, so I don't know if it's simpler to pass it to ALL states, or move that logic back out into the player object.
player state machine was refactored. state.gd now has get_velocity() and set_velocity() functions. Those are utilized inside player set_state() method to pass velocities around.
Currently, each state in the player state machine handles movement, which means keeping track of velocity vectors and gravity.
That creates a problem when players change states. The states lose track of their previous velocity.
For example: When jumping or falling, if the player gets hit by a bullet, they'll freeze in mid-air.
Can solve this in two ways: