Fix collision being off by half a tile

In is_valid_position(), we need to use floor() instead of round(). This
is because we want to get the tile that contains the given point, as
opposed to the nearest tile.

This change caused an issue with sliding against bottom and right walls.
A fix was added to "force" sliding when such situations arise.