Nez: free, open source 2D framework

The constraints fixed a lot of the issues! However,there is still one thing that is not working. For slopes at least 2 tiles high, there are some cases where the edge of the entity collides with the tile horizontally adjacent to the slope tile before the entity has ascended to the tile above it. This causes the entity to get stuck as a wall tile is preventing horizontal movement. I think the issue is related to line 259 on TileMapMover.cs

            if (direction.isHorizontal() && collisionState._lastGroundTile != null && collisionState._lastGroundTile.isSlope() && _collidingTiles[i].isSlope())

The last && piece only ignores a collision tile in horizontal movement if it is also a slope tile. I removed the last &&, changing the line to

             if (direction.isHorizontal() && collisionState._lastGroundTile != null && collisionState._lastGroundTile.isSlope())

And it fixed the issue. The only problem is that this creates a side effect, where if your slope leads directly to a wall, the entity will go be able to go through the wall (as the above code exempts all horizontal collisions while on a slope), which messes everything up. This case is easy to avoid, but I think the best solution may be to determine if the tile is adjacent to a slope tile and exempt those tiles from horizontal movement, but I haven’t come up with the best way to do that yet. I can probably provide pictures/examples if it would be useful to illustrate the issue.