LevelManager - nhmkdev/support-framework GitHub Wiki
Definition
The Level Manager is a basic wrapper around the ImpactJS level loading functionality.
Container
Level Data
var Levels = ig.global.data.levels;
Level Manager Object
var LevelManager = ig.global.support.levelmanager;
Data Format
Levels.sample = // NOTE: 'sample' is an example level id used by the LevelManager
{
n:'sample', // name -- intended for display purposes, not used by code otherwise
s:false, // The default level to load if true (default: false)
//m:'music', //music
//TODO: lots of other settings!
}
Usage
A very basic level load: LevelManager.loadDeferred(levelId) This uses the levelid specified in the ig.global.data.levels object.
Also see the LevelManager code file.
Adding Levels
Be sure to update both the levelrequires.js and levels.js files (TODO: combine the two?)