javascript - Programmatically insert entities in melonJS -
i have been working way through melonjs tutorial while keeping application in mind in of head.
i want able add together entities programmatically rather specifying them in .tmx file gets loaded in each level. possible in melonjs or must entities specified using tiled editor? seems rather restrictive.
or melonjs wrong framework such task, , if there framework might work improve drawing on canvas?
you can add together objects programmatically. here writes it.
to resume, can this:
in screen function, add together "classes" pool of melon:
onresetevent: function() { // tell entity pool classes needs work me.pool.register('main', game.mainentity, true); },
then,when need create new object of type pool
var mainobject = me.pool.pull('main', 100, 100, otherdata);
and when need add together game phone call this.
me.game.world.add(mainobject);
finally if need remove it.
me.game.world.removechild(mainobject);
some more info pool
this still compatible new version of melonjs 2.0.x
javascript game-engine melonjs
No comments:
Post a Comment