1 decade ago by lazer
I had this problem before and assumed it had something to do with how I was generating and moving a background map in the code. However, I've pretty much recoded the entire project and now the only background maps are those created in Weltmeister. The issue is:
I have a 1136 x 640 game window with a background map of the same size (consisting of 16px tiles). This background map is set to preRender and Repeat.
I have camera code that's set to follow the player, which always stays visually in the middle of the screen.
When the player moves right and/or down, the background map repeats fine. Everything looks exactly as it should.
When the player moves up and/or left, the background map does not repeat properly. The next piece of map seems to load way too late, resulting in distortion (the kind you get when you have no background map at all).
Turning off preRender seems to fix this, but increases my draw calls massively and causes a lot of lag.
What am I missing here? I'm clearly doing something wrong, I just can't figure out why the map refuses to repeat in those two directions but has no problem with the other two...
I have a 1136 x 640 game window with a background map of the same size (consisting of 16px tiles). This background map is set to preRender and Repeat.
I have camera code that's set to follow the player, which always stays visually in the middle of the screen.
When the player moves right and/or down, the background map repeats fine. Everything looks exactly as it should.
When the player moves up and/or left, the background map does not repeat properly. The next piece of map seems to load way too late, resulting in distortion (the kind you get when you have no background map at all).
Turning off preRender seems to fix this, but increases my draw calls massively and causes a lot of lag.
What am I missing here? I'm clearly doing something wrong, I just can't figure out why the map refuses to repeat in those two directions but has no problem with the other two...