Class me.levelDirector
Defined in: <build/melonJS-0.9.3.js>.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
a level manager object
once ressources loaded, the level director contains all references of defined levels There is no constructor function for me.levelDirector, this is a static object |
| Method Attributes | Method Name and Description |
|---|---|
|
return the current level id
|
|
|
loadLevel(level)
load a level into the game manager
(will also create all level defined entities, etc. |
|
|
load the next level
|
|
|
load the previous level
|
|
|
reload the current level
|
Class Detail
me.levelDirector()
a level manager object
once ressources loaded, the level director contains all references of defined levels
There is no constructor function for me.levelDirector, this is a static object
once ressources loaded, the level director contains all references of defined levels
There is no constructor function for me.levelDirector, this is a static object
Method Detail
{String}
getCurrentLevelId()
return the current level id
- Returns:
- {String}
loadLevel(level)
load a level into the game manager
(will also create all level defined entities, etc..)
(will also create all level defined entities, etc..)
// the game defined ressources
// to be preloaded by the loader
// TMX maps
...
{name: "a4_level1", type: "tmx", src: "data/level/a4_level1.tmx"},
{name: "a4_level2", type: "tmx", src: "data/level/a4_level2.tmx"},
{name: "a4_level3", type: "tmx", src: "data/level/a4_level3.tmx"},
...
...
// load a level
me.levelDirector.loadLevel("a4_level1");
- Parameters:
- {String} level
- level id
nextLevel()
load the next level
previousLevel()
load the previous level
reloadLevel()
reload the current level