Hi,
I currently have normal set of character with lot of controls and checks: Run, Jump Left/Right, Double Jump, Roll). They were split into "Left and Right" and "Jump and Roll" FSMs.
Now I plan to add attack controls/actions which are similar with normal movements: Jump Left Attack, Jump Right Attack, Roll Attack. The only difference is: Those actions only happen when user meets enemies.
Reference:
So my question is: should I add new controls to current FSMs (which is quite big and complex already) to reuse the current actions and check? Or should I add new FSMs which will use a lot of similar States and FSM actions?
Update:
I tried to add check state to every action state of normal movement like:
- If IsEnemyAround = True -> Send and Event to "Attacks" FSM
- If IsEnemyAround = False -> FINISH -> Continue to next State.
However, It still add many states to current FSM ones. And I don't know how to switch back to normal movement after finish that Movement on "Attacks" FSM since cannot send event back.
Thanks.