Getting Started with PRState

Looking for the docs for the older (pre-GMS v2.3) version of PRState? Click here.

Step 1 - Inherit from oPRState Object

Drag the oPRState object from your assets list to the Parent window of your object.

Image

Step 2 - Add States

Inherit the Create event and begin adding states to your object using the PRAddState() method.

Image

Step 3 - Write State Implementation Methods/Functions

Copy and paste the handy method snippet provided in the PRState package into your object's create event, and fill it in with your state implementation code.

Image

Step 4 - Set Object States at Key Points

Use the PRSetState method to switch from one state to another at key points in your game logic. As each state has their own implementation method, this will result in the object changing behaviours with a single command.

Image

© 2021 Prismatic Realms, Inc. Contact

Green Hosting Badge