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 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:

/><br />
(Yes I'm using Zelda placeholder art :P)<br />
<br />
You can see there's no pink show chunks outline around the top part. As soon as the player is touching that empty part, the new chunk at the top finally shows up. The same is true if I make the chunk size smaller. No new chunks get drawn until the player touches a non-drawn area and then the background fills the screen.			</div>
		</div>
			<div class=

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

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 »