Hi! Thanks for the comment. 🙂
Video game development is a very interesting branch of our industry! It's one of the few where state machines are used to handle complex logic, like the behavior of characters. It apparently turns out that using IFs and boolean flags for complex, stateful behavior (like games or UIs) makes the code a lot harder to understand and work with.