This project implements a Finite-State-Machine (FSM) designed to be used in games.
Furthermore it implements even a Stack-Based-FSM (SBFSM). So you may tell it to ‘continue with the last state before the active one’.
You describe your FSM using a nice and well documented DSL (Domain Specific Language).
– Oh! Please don’t forget to star the repo, if you like it. Thx. –
It comes in two flavors (described in the README.md). A plain state-machine and one that needs MonoGame since it uses the GameTime object. That enables you to ‘time’ the transitions (say: duck, then stand up after 5 seconds).
Feel free to comment, PR or just use it.
Unlicense.
Nuget provided in README.md on Github.
(Since this is not a game, maybe I should move this topic, but I don’t know where. Suggestions are welcome.)
I didn’t really look into the code, but it may be useful to just use TimeSpan for the elapsed time instead of GameTime or a custom struct if just a TimeSpan isn’t sufficient to make the code work standalone.
Hmmm. You’re right of course.
I wanted it to fit seamless into the MG.Update(GameTime) I think. But now, days later, I really don’t know why I didn’t do it as you say…
Added it to issues for further considerations. Thx.