Saturday, May 10, 2014

Problem #4: Sprites fall through the tilemap

Another problem that I face after creating the tilemap is that, although I intend to use tilemaps for platforms, sometimes the character would fall through the platform, or just go through it.

(And actually only after I get this problem I started thinking that it might be good to make a log of the development for future reference)

After thorough googling, I find the solution from this thread:
http://www.html5gamedevs.com/topic/4929-20-arcaded-tile-collision-issue/

This line of code in function update() do the magic:
this.game.physics.arcade.TILE_BIAS = 40;

The number 40 also did the magic for me, so I didn't change the value. But if you find your character still going through the tiles, just increase the value.

No comments:

Post a Comment