1 decade ago
by ansimuz
Hi,
I'm making a game that has a lot of levels everytime i create a level i need to add by default 3 entities.
It's there a way to config weltmeister to automatically load some entities so the development process is faster.
thanks
1 decade ago
by Joncom
Sure. Not in Weltmeister, but this should do the trick:
/* main.js */
loadLevel: function(level) {
this.parent(level); // Loads the level.
this.spawnEntity(EntityA, 0, 0);
this.spawnEntity(EntityB, 0, 0);
this.spawnEntity(EntityC, 0, 0);
}
1 decade ago
by ansimuz
Joncon,
Thanks but i need it to load it on weltmeister since i need to make adjustments for each level visually.
What i wanted is that everytime i create a level on WM it adds by default 3 entities that i will always need.
1 decade ago
by lTyl
I guess you could modify Weltmeister and automatically add the Entity data to the JSON level file everytime you click the New button. It would probably look something like this:
level.entities.push(
{"type": "EntityA", "x": 0, "y": 0})
1 decade ago
by ansimuz
ITyl,
Thanks, that's exactly what i needed. I modified the weltmeister.js inside the loadNew() function, around line #285 and added tje following line:
this.entities.spawnEntity( "EntityPlayer", 0, 0 );
Page 1 of 1
« first
« previous
next ›
last »