Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Just implemented the gdx-ai StateMachine in my code. Feels much cleaner! Here is my github repo if you want to check out what I have done https://github.com/bazola/spacey-life/tree/add-gdx...

Setting it up is pretty simple. After you import gdx-ai into your project, you initialize the StateMachine class like this:


Then you update it each tick like this:


Here is the entire AlienState enum, which is the key thing that controls the flow of the logic for the AI: