1 decade ago by lazer
I have a background map. It does this at intermittent intervals (so not constantly):
The problem is, it looks like this on my screen, with everything being distorted:
http://i.imgur.com/O5HPl.png
Here is a video of what it's meant to look like (this video does not have the scrolling background in it, but you get the idea...): http://www.youtube.com/watch?v=Zz3XpnKrWag
If I change that += to -= and make it scroll the other way, everything is totally fine and there is no distortion whatsoever. What gives? Am I missing something really obvious here?
Here is how I am creating the background map, when the level is loaded:
ig.game.mainBackground.scroll.y += ig.system.tick * 3;
The problem is, it looks like this on my screen, with everything being distorted:
http://i.imgur.com/O5HPl.png
Here is a video of what it's meant to look like (this video does not have the scrolling background in it, but you get the idea...): http://www.youtube.com/watch?v=Zz3XpnKrWag
If I change that += to -= and make it scroll the other way, everything is totally fine and there is no distortion whatsoever. What gives? Am I missing something really obvious here?
Here is how I am creating the background map, when the level is loaded:
var data = [[1,2,3,4,5,6,7,8],[9,10,11,12,13,14,15,16],[17,18,19,20,21,22,23,24],[25,26,27,28,29,30,31,32],[33,34,35,36,37,38,39,40],[41,42,43,44,45,46,47,48],[49,50,51,52,53,54,55,56],[57,58,59,60,61,62,63,64],[65,66,67,68,69,70,71,72],[73,74,75,76,77,78,79,80],[81,82,83,84,85,86,87,88],[89,90,91,92,93,94,95,96]]; this.mainBackground = new ig.BackgroundMap( 40, data, 'media/backgrounds/lvl1-2.png' ); this.mainBackground.repeat = true; this.mainBackground.preRender = true;