Home - matan1905/GameMechanicManager GitHub Wiki
Welcome to the GameMechanicManager wiki!
This wiki is under construction
Wiki todo:
-
Explain about what this repo and how to use it(this page)
- Events & notifications
- mechanics
- settings
- datasource
-
How to make a mechanic with examples DONE! but I need to break the final code a little
-
How to implement a mechanic in a game with examples DONEEE
-
How to wrap a datasource
What is Game Mechanic Manager
game mechanic manager is a library that allows you to code the logic part of your gameplay mechanic and make it a standalone, which will allow you to both share your own and use other people's complex mechanic with just a few lines of code!
Components of Game Mechanic Manager (GMM from now on)
- GameMechanics objects to handle events and send notifications
- Setting Object, to store and change key-value settings
- Datasource, to persist data
Game Mechanics
GameMechanics is a class that can be extended to create new mechanics, if you are making a mechanic check out the guide on how to make one, or read the documentation of the class
Events and notifications
The game mechanics listen to events, returning a callback if needed and receive any further data using the arguments
The game mechanics sometimes may need to notify you about something and have no callback to use, so they can use the notification system (which you have to implement when creating an instance of GMM) to send you updates.
Settings
The settings are useful Key-Value store, the game mechanic can expose the developer more control over the mechanic and the refreshSettings allow the developer to edit those live in case he has implemented it.
Data sources
Data sources are important tool to save and persist information, it is used primarily by the game mechanics and can be wrapped with a lot of different database structures, so maximum robustness for the game developer.