wFSM for GameMaker
wFSM v1.2.1
wFSM is an easy-to-use Finite State Machine library for GameMaker.
Finite state machines are structures that can exist in a set amount of predefined states that contain unique behaviors. While finite state machines are used very commonly in game development, GameMaker does not have a built-in way of setting them up easily. This library allows you to set up your own finite state machines with minimal effort and helps you keep them all organized.
This library is only tested on the Windows, HTML5, and GXC targets, but it should work on other platforms as well. It also comes with an example project that will show you the basics.
Since I made this library primarily for my own personal projects, I will keep updating it on a regular basis.
This library is made by Mors (Website | Patreon).
Basic Usage
// The states as an enum. enum test_state { example1, example2, } // Create the finite state machine. state_machine = new StateMachine(); // Create state 1. var _state1 = new State(); // Set the code that will be executed at the step event. _state1.update = function() { x += 4; if (x > room_width) x = -256 } // Create state 2. var _state2 = new State(); // Set the code that will be executed at the step event. _state2.update = function() { x -= 4; if (x < -256) x = room_width } // Add the states to the finite state machine. state_machine.add(test_state.example1, _state1); state_machine.add(test_state.example2, _state2);
To learn more about how to use this library, check out the API Reference.
License
The main script for the library (the "scr_wfsm.gml" file) is licensed under MPL 2.0. You can learn more about it here, with Q8 being the most relevant part for most game developers. The rest of the repository is licensed under public domain.
Changelog
You can view the full changelog on GitHub.
If you have any questions, you can ask them in the comments section down below, or create an issue in this library's GitHub repository.
Status | Released |
Category | Assets |
Rating | Rated 5.0 out of 5 stars (1 total ratings) |
Author | Mors |
Made with | GameMaker |
Tags | finite-state-machine, fsm, GameMaker |
Code license | Mozilla Public License 2.0 (MPL) |
Download
Click download now to get access to the following files:
Development log
- v1.2.1 UpdateMar 31, 2022
- v1.2.0 UpdateNov 09, 2021
- v1.1.1 Update!Mar 12, 2021
- Finally works on HTML5Aug 18, 2020
- v1.1.0 Update!Jul 07, 2020
- v1.0.1 Update!Jun 27, 2020
Comments
Log in with itch.io to leave a comment.
Impressive work
Thanks!