I replaced my messy if/then/switch spaghetti code with a #FSM. What a big improvement in readability! Now I want to turn everything in my game into FSMs.
@hamrath that’s a nice turn! I am in love with FSM for quite some time. Surprised it’s not everywhere by now
@glukozavr My code got worse every time I added a new feature. In the end I mixed up winning conditions, player states, tutorial mode, camera, etc. and began to search in files for variables and functions I couldn't find anymore.
Now that I understand them, FSMs seem to be a viable option to get rid of this mess. And now that I understand how they work I'll add them not only to the player. Even my level manager could be improved with a FSM.
@hamrath yes, it gives the structure to the code that finally is readable and much more manageable when without it