Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Finite state machine

A topic by joseluisgomezcecena created Aug 22, 2022 Views: 157 Replies: 1
Viewing posts 1 to 2

Hi Rob! 

I bought your platformer engine but i cant find the finite state machine i want to add another attack but cant find where to add another state.

Developer

Hi Jose,

Thanks for reaching out. If you look in the script "motion" you will find all the states under the green comments (collapse all regions).

Instead of a classic switch statement, the script uses if statements and calls exit (exiting the code) after performing actions for a certain state.

If you want to use a classic switch statement, just add a switch statement and state variable, wrap the original code in another state  that you call whatever you want and  voila!