Available on the YoYo Games Marketplace and on Itch.io.
Requires GameMaker Studio 2 v2.3 and up.
PRState is a GameMaker Studio 2 (GMS) package created by Prismatic Realms, Inc. It enables you to implement a simple and efficient finite state machine for your GMS objects. PRState is designed to compartmentalize your object's state implementation code so that they are segregated from each other and from the rest of your object's code. What this means is that, for example, your hero character's walk/run code lives in its own function or method. The same goes for his attack code, and his double-jump code, etc. This results in code that is more organized and easy to trace and debug, rather than having all that code lumped together into your Step event(s)
Note that PRState can be used for more than just keeping track of character states. Consider using PRState to track the different states of your UI objects (buttons, check boxes, etc.) or to track which magical energy a sword is currently imbued with. There are many uses for finite state machines. Any object with more than one behaviour can benefit from this module.
This package contains an object that implements PRState that your objects can derive from. The package also contains documentation on how to use the module and example code that you can learn from.
The included examples feature artwork by Penusbmic (used with permission.)
- Add any number of states to your objects.
- Associate specific methods or functions to your states to handle their implementation.
- Change the object states at any time.
- Handy convenience method to switch to previous state.
- Impose restrictions as to which states can transition to other states, handled automatically by PRState.
- Organized implementation. Your state methods/functions will be called once to initialize itself when set; once to cleanup after itself when the state is about to be switched away; and once every frame to run your implementation code.
- Debug logging to help you track when objects change states.
- All professionally written in GML.
- Includes examples and documentation within the package.
- Fast and friendly support via email if and when you need it.