1 decade ago by yatayata
how are people jumping between levels?
I have some random ways of moving between levels so have defined some portal type entity to load a new level. using weltmeister i can pass in a property like targetLevel="someLevelName".
however this means i need to refer to the levels as strings.
so i need to do
however, impact is expecting an Object, ie LevelIntro
this object is created by weltmeister, eg a level file contains
so how can i random access and jump around levels?
one thought is to hack weltmeister to also add a levelName property and build a list of these as the game initializes... but this seems a bit messy (then will be harder to upgrade WM etc...)
so i guess what i really need is to convert the variable name to a string, to which there are some hacky methods... looking through global objects... eg
window["LevelIntro"] == LevelIntro
any clean suggestions appreciated!
I have some random ways of moving between levels so have defined some portal type entity to load a new level. using weltmeister i can pass in a property like targetLevel="someLevelName".
however this means i need to refer to the levels as strings.
so i need to do
loadLevel("intro");
however, impact is expecting an Object, ie LevelIntro
loadLevel(LevelIntro);
this object is created by weltmeister, eg a level file contains
LevelIntro=/*JSON[*/{"entities":[{"
so how can i random access and jump around levels?
one thought is to hack weltmeister to also add a levelName property and build a list of these as the game initializes... but this seems a bit messy (then will be harder to upgrade WM etc...)
so i guess what i really need is to convert the variable name to a string, to which there are some hacky methods... looking through global objects... eg
window["LevelIntro"] == LevelIntro
any clean suggestions appreciated!