Class: MicrogameJam

MicrogameJam()

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
Source:

GameLoader

Reference to gameloader.js
Source:

GameMenus

Reference to menumanager.js
Source:

GameSound

Reference to gamesound.js
Source:

(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).
Source:

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.
Source:
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.
Source:

playButtonClick()

Callback for any buttons clicked on. Plays click sound. Initialized in MicrogameJam.
Source:

playButtonHover()

Callback for any buttons hovered over. Plays hover sound. Initialized in MicrogameJam
Source:

startMicrogames()

Hide the menu, and start the gameloader (using the transition function).
Source:

update(time)

Parameters:
Name Type Description
time number Time elapsed since last frame.
Source: