I've got a problem with my tilemap based collision detection. The problem is getting stuck on walls and I was wondering what the method is to tackle this issue.
For example moving left/right works ok and also checking for solid tiles above and below. However diagonal movement causes the issue where the player sprite sticks to the wall.
Currently if a check is made on a point around the sprite for example -1 pixel and this tile is found to be solid then the player x position is set to be to the right on the solid tile (player.position.x = (tile.X / 16)+ player.width) - so in effect the player just stops moving left.
Should you first check for and correct X positioning before moving onto checking and correcting Y positioning? Currently I am checking X/Y then correcting X/Y.