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 stahlmanDesign

I had a problem in my game and another simple project where what I drew in weltmeister would not show up. But upon saving and loading the game, the drawings were there. This happened in Safari, Firefox and Chrome. You could choose your tile but when you drag to draw, it just appears as invisible.

I think the problem was related to preRender=true in background-map.js in Impact.

But it was confusing because sometimes the browser keeps things in cache even after you quit, so it was hard to figure out what was causing it.

Besides that redraw bug, preRender=true screwed up my background tiles in Weltmeister layout, but not in the game. There were large areas of black between the background tiles. But with preRender=false -- and cache emptied -- it seems to have gone away.

1 decade ago by fugufish

was this with 1.18 or 1.17?

1 decade ago by stahlmanDesign

1.18, but I don't know if it was caused by the upgrade. It doesn't affect the game unless you are editing levels, so I'm not sure when I first encountered it. I had the problem on two different machines, but it's always best to hear if other notice the same problem, or if it's just something I have missed that's my own specific problem. After a day of testing I was sure it was not my mistake so that's why I posted. But I'm often wrong.

1 decade ago by Hareesun

Yeah, I’ve also noticed and can repeat this easily.

One way around it is to have...
for(var i = 0; i < this.backgroundMaps.length; i++){
    this.backgroundMaps[i].preRender = true;
}

in your games init()

This basically tells the maps to prerender as they load instead of before.

1 decade ago by stahlmanDesign

@ Hareesun That's a great solution, just have it turn on preRender when you load the game, but not affect Weltmeister. I'll try it. You can also turn it on using the 1.18 debug panel which shows that preRender definitely helps have fewer things to draw.

EDIT: I just put it in my main.js init() function and it works perfectly.

1 decade ago by stahlmanDesign

Just a precision, you have to put
for(var i = 0; i < this.backgroundMaps.length; i++){
    this.backgroundMaps[i].preRender = true;
}

in the init() function AFTER you load your level, and it doesn't show up correctly in the debug panel. It appears to be off, but it is really on (you can tell by the number of draws which is reduced).
Page 1 of 1
« first « previous next › last »