1 decade ago by drhayes
Here's the project on GitHub.
I got tired of the cascade of if-then-else that was showing up in my code, particuarly around animations (e.g. if player just crouched but hasn't finished the crouching animation and isn't crawling yet then show the "crouching" animation unless the player is blah blah blah), so I made this library.
Now I can do things like have a "crouching" state that doesn't transition to a "crouched" state until the animation is done and handles all the corner cases. It also lets me separate the animation logic from the movement logic in my entities so that they respond to velocity changes without explicit animation code.
Let me know if anything isn't clear or if it's missing some feature or other that you might find useful.
I got tired of the cascade of if-then-else that was showing up in my code, particuarly around animations (e.g. if player just crouched but hasn't finished the crouching animation and isn't crawling yet then show the "crouching" animation unless the player is blah blah blah), so I made this library.
Now I can do things like have a "crouching" state that doesn't transition to a "crouched" state until the animation is done and handles all the corner cases. It also lets me separate the animation logic from the movement logic in my entities so that they respond to velocity changes without explicit animation code.
Let me know if anything isn't clear or if it's missing some feature or other that you might find useful.