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

1 decade ago by doobdargent

since Weltmeister loads all the level's entities at init(), I don't want my game to consume resources trying to draw off screen entities.

So I've override the Entity.draw() methods like this:

draw: function(){
            if(! return;

The thing is, in Weltmeister, the entities are now hidden.
Any idea why?


1 decade ago by doobdargent

Well, just the fact to write the question helps me to think differently. does not exists in Weltmeister context. Any way to determine if I'm in weltmeister context or in game?

1 decade ago by doobdargent

Found it!


Works like a charm. By the way I should have read the class reference much sooner. Lots of useful helper functions there!

1 decade ago by unstoppableCarl

What exactly did you do to resolve this?

1 decade ago by doobdargent

To determine if you're in weltmeister you can use this:
if(typeof(wm) != 'undefined') return;

To spare resource while your entities are offscreen I remove them from the array. (So it doesn't get updated/drawed/checked)

I remove them using entity ); because entity ); will make some unwanted changes (like set _killed to true).

1 decade ago by alexandre

IIRC, this works too.
if (
  // ...

1 decade ago by doobdargent

Thanks for your input alex, much more readable like this ;)
Page 1 of 1
« first « previous next › last »