new MicrogameJam()
Main game controller.
For controlling the primary functions, all calls should get routed through here.
- Source:
- Tutorials:
- See:
-
- module:main
Members
GameAnimation
Reference to animationmanager.js
GameLoader
Reference to gameloader.js
GameMenus
Reference to menumanager.js
GameSound
Reference to gamesound.js
(private) inGame
Are we currently loaded into a game? Set to true when module:gameinterface/GameInterface calls its _endedGame function (i.e., the microgame calls WinGame or LoseGame).
masterVolume
Bit of a misnomer, unfortunately. It’s just used to keep track of what the volume should be when modified by the settings and to update the audio manager appropriately when that happens.
- Source:
- To Do:
-
- I should probably just move this to a static variable in gamesound.js. Oh well.
Methods
endGame(didWin)
Called by GameInterface in the _gameEnded function. Called during a win, loss, or automatic loss.
Calls Game Loader transition.
Parameters:
Name | Type | Description |
---|---|---|
didWin |
boolean | Whether or not the game was one. |
Returns:
The difficulty after transitioning.
gameStarted()
Called by GameInterface in the gameStart function. Used by the framework when it detects that a game is ready to start.
Stops loader behavior, and tells GlobalInputManager to be ready to receive game inputs.
playButtonClick()
Callback for any buttons clicked on. Plays click sound.
Initialized in MicrogameJam.
playButtonHover()
Callback for any buttons hovered over. Plays hover sound.
Initialized in MicrogameJam
startMicrogames()
Hide the menu, and start the gameloader (using the transition function).
update(time)
Called every animation frame. Updates all the logic for the:
Animation Manager (frameUpdate)
Version Style (versionStyleUpdate)
Game Loader (loadUpdate)
GlobalInputManager (updateInput)
Parameters:
Name | Type | Description |
---|---|---|
time |
number | Time elapsed since last frame. |