PRState for GameMaker Studio 2
A downloadable GMS2 package
Also available on the YoYo Games Marketplace.
PRState is a GameMaker Studio 2 (GMS) module 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.
The download file is a signed GMS2 local package that can be imported into your projects. It contains a parent 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.
Friendly support is just an email away and you can expect a quick turn-around to answer your questions and resolve issues. As always, comments and suggestions are welcome!
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.
Requires GameMakerStudio 2 v2.3 and up.
In order to download this GMS2 package you must purchase it at or above the minimum price of $1.99 USD. You will get access to the following files:
- PRState Website CompleteJan 24, 2021
- PRState Website Partial UpdateJan 24, 2021
- New tutorial video available for PRState.Jan 21, 2021
- PRState v2.0.2 released. Small bug fix.Jan 11, 2021
- PRState has been updated for GMS2 v2.3 and is now on Itch!Jan 10, 2021
Leave a comment
Log in with itch.io to leave a comment.