Members
Methods
# static Draw()
Static function that functions as a replacement for p5.draw. This calls Update from the GameManager Instance.
# static GetInstance()
Function to retrieve the current instance of the GameManager. Always use this function instead of the constructor!
When no instance is available, one is created.
The singleton instance of the GameManager.
# static KeyPressed()
Static function that functions as a replacement for p5.kyePressed. This calls KeyPressed from the current Game instance.
# static Setup()
Sets up a Game instance, defined by the type of Game in Settings/Settings.js
# AddGameObject(gameObject)
Adds a GameObject to the current game.
Parameters:
Name | Type | Description |
---|---|---|
gameObject |
GameObject
|
The GameObject to be added to the scene. |
# AddGameObjectToCollisionLayer(gameObject, collisionLayer)
Puts the given GameObject on the given Collision Layer. Collision Layers are defined in Settings/Settings.js
Parameters:
Name | Type | Description |
---|---|---|
gameObject |
GameObject
|
The GameObject to be added to the collision layer |
collisionLayer |
Settings.collisionLayer
|
Collision layer defined in the Settings file |
# RemoveGameObject(gameObject)
Removes a GameObject from the scene.
Parameters:
Name | Type | Description |
---|---|---|
gameObject |
GameObject
|
The GameObject to be removed from the scene. |
# Update()
Update draws all GameObjects in the correct order and draws debug information in case Settings/Settings.js/Debug was set to true.