1 decade ago by grelca
So in this game I'm working on, the screen follows around the player. It's going to be like.. the player follows a path and tries to collect all the coins and avoid obstacles and potentially neverending, so I decided on using a repeating background map. But as my player moves up, this is what happens:
1 decade ago by Nico
I believe you can set it to pretender in weltmeister.
1 decade ago by grelca
I do have it set to prerender. This is only happening when it's being prerendered.
1 decade ago by grelca
After some experimenting I was able to fix this by changing
to
in the drawPreRendered function in lib/impact/background-map.js
Just in case anyone else comes across this problem!
I'm still super unclear on why the entity's position would determine when the new chunk finally showed up, though. And it seems to me like that had to be it somehow, because I moved the entity around the game screen and it was always based on where the entity was.
var minChunkX = Math.max( Math.floor(dx / this.chunkSize), 0 ), minChunkY = Math.max( Math.floor(dy / this.chunkSize), 0 ),
to
var minChunkX = Math.min( Math.floor(dx / this.chunkSize), 0 ), minChunkY = Math.min( Math.floor(dy / this.chunkSize), 0 ),
in the drawPreRendered function in lib/impact/background-map.js
Just in case anyone else comes across this problem!
I'm still super unclear on why the entity's position would determine when the new chunk finally showed up, though. And it seems to me like that had to be it somehow, because I moved the entity around the game screen and it was always based on where the entity was.
Page 1 of 1
« first
« previous
next ›
last »