I have changed <!----> if (absDepthY < absDepthX || collision == TileCollision.Platform) to if (absDepthY <= absDepthX || collision == TileCollision.Platform)