Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Aitor

Yesterday I made some levels with weltmeister and everything worked fine. But today I've made a simple modification on one of the entities used by weltmeister (EntityCopter) just putting this line where I specify the size, offset,type...:
name:'test'
And then I loaded weltmeister, but the level was messed up: the background layers were all black, I couldn't select them to add new tiles, the numbers on the top and left sides of the window were missing, If i created new layers I couldn't add tiles to them...
I created a new level, and everything worked fine until I added a copter entity, then the numbers on the top and left sides disappeared again, and If i saved an loaded the level It didn&039;t work again. I deleted the #name:'test' in the copter entity, but It still doesn't work. Any idea why this happens?

1 decade ago by Aitor

I think I know why it's happening: In the draw function of the Entity, I use a global variable that is declared in main.js (where the ig.Game subclass is defined), and that works fine in the game, because the game instance I what loads everything else, but when weltmeister tries to draw the entity, it finds that the global variable isn't defined (I've seen this in the firebug console). I use this variables to draw some lines directly in the canvas. Is there a way to know If the draw function is called from weltmeister or something?

1 decade ago by alexandre

draw: function()
{
  if (ig.global.wm)
  {
    // do wm stuff
  }
  // do other stuff

1 decade ago by Aitor

Thank you a lot!
Page 1 of 1
« first « previous next › last »