How the hell should one setup a top-down 2D game correctly?

I didn’t wanted to go through this first, as I thought it would be too weird for the player to be stuck so far from the edges (because the player can only move from tile to tile in my project).

I started imagining a way to encode in the tiles that directions could be blocked by placing a collision shape of a single vertex in their direction.


Here I could have blocked moving left and right on this tile (no matter what is to its left or right). And ofc, a shape of a single vertex is nothing, it’s just a way for me to encode it into the tile’s metadata to read it at runtime.

It would have taken a bit of time to get it working, but I think I could have come up with something.

Anyway, I tried to see if creating a Blockout TileSet with blocking edges was that disturbing…and it’s good enough!
The final result :
image
Blocking Ground layer :
image
Walkable Background layer :
image

The player will be just above the ground layer to appear in front of it. And anything we put to the ground layer should have a blocking collision. This way there would be no weird overlapping issue with the player.
Then we could have as many Background layers below the Ground layer as we want, the same for Foreground layers above the Ground layer and the player.

I think I started to find a good way to make my project work. Thanks again for your support !