obiot/melonJS — Issue #39: init (True)  and TMX loadLevel issue
Author: norb42
Created: 2012-01-25 22:22:59+00:00
State: open

Hello,

I'm quite new with MelonJs but I show something that I didn't expect and didn't find any topic related to that point.

If inside an init function you place this.parent(true) you should be able to use draw and update function but if you load a TMX level those function are still not activated.

Code to test :

var PlayScreen = me.ScreenObject.extend(
{
init: function()
{
//can't work with a loadlevel
this.parent(true);

},

onResetEvent: function()
{
me.levelDirector.loadLevel("area01");
},

update: function()
{
//can't work since a loadlevel is in place
alert("this never occur, if you comment the load level it will work without trouble");
}
});

Thanks for your feedback.

PS: MelonJS is quite interesting, thanks for your work !!