CarrotKutay/Colosseum

Finite State Machine

Closed this issue · 0 comments

It becomes apparent, that for different behavior entities are performing, it is necessary to know what kind of behavior they are already going through currently. Therefore, the implementation of finite state machine seems to be helpful.
#15 #10 #28

Finite State Machine

States needed:

  • Grounded (entity is touching the ground)
    • additional condition: feet are touching ground, we do not care about other body parts touching ground
  • Start Jumping (Jump is initiated through input event and y-directional velocity on entity is positive)
    • additional implementation: get a jump counter and a maximum number of jumps allowed for possible double jumps or conditions that can reset entity to let it jump more times
  • Free fall (entity is not touching the ground and y-directional force is less or equal to 0)