1 decade ago by MyShuitings
This is driving me insane.
I've got the level change entity with the following settings:
level: two
name:leveltwo
and a trigger with target.1: leveltwo
When it triggers I am getting an error in game.js line 36 where it tries to access the level and get the entities.
Now, I've made sure that in main.js I am loading the level as such: 'game.levels.two', and if I use firebug I can see the object in the DOM... but when the loadLevel tries to call it from when the game is already running I get this error. (I tried binding F2 to call it by hand, and no dice). I can load that level directly as the first level in main.js... but get errors when I try to load any subsequent level... I even went to the extreme of copying the code from game.js and trying to run it by hand on a key press... same error.
Has anyone else ran into this or similar issue?
Below is the nasty error:
Uncaught TypeError: Cannot read property 'length' of undefined
ig.Game.ig.Class.extend.loadLevel game.js:36
EntityPlayer.ig.Entity.extend.update player.js:101
window.ig.Class.extend.prototype impact.js:358
ig.Game.ig.Class.extend.update game.js:144
MyGame.ig.Game.extend.update main.js:86
window.ig.Class.extend.prototype impact.js:358
ig.Game.ig.Class.extend.run game.js:128
ig.System.ig.Class.extend.run system.js:98
(anonymous function) impact.js:52
I've got the level change entity with the following settings:
level: two
name:leveltwo
and a trigger with target.1: leveltwo
When it triggers I am getting an error in game.js line 36 where it tries to access the level and get the entities.
Now, I've made sure that in main.js I am loading the level as such: 'game.levels.two', and if I use firebug I can see the object in the DOM... but when the loadLevel tries to call it from when the game is already running I get this error. (I tried binding F2 to call it by hand, and no dice). I can load that level directly as the first level in main.js... but get errors when I try to load any subsequent level... I even went to the extreme of copying the code from game.js and trying to run it by hand on a key press... same error.
Has anyone else ran into this or similar issue?
Below is the nasty error:
Uncaught TypeError: Cannot read property 'length' of undefined
ig.Game.ig.Class.extend.loadLevel game.js:36
EntityPlayer.ig.Entity.extend.update player.js:101
window.ig.Class.extend.prototype impact.js:358
ig.Game.ig.Class.extend.update game.js:144
MyGame.ig.Game.extend.update main.js:86
window.ig.Class.extend.prototype impact.js:358
ig.Game.ig.Class.extend.run game.js:128
ig.System.ig.Class.extend.run system.js:98
(anonymous function) impact.js:52