Sorry about the vague title, it's kind of hard to say what I want to do in a few words.
In my top-down game, I'm having a problem implementing proper collision for walls facing north (that is, you can actually see the surface of the wall, as opposed to the other directions, where you can see just the top).
I have a proper bounding box that detects the alpha values of the sprite, and generates a proper bounding box around only the visible pixels, like so:
However, when dealing with walls, I run into a problem. With my current implementation, there are two options I have:
- Set the walls so that the player can pass through them. This leads to the player walking "on" the walls, like so:
- Set the walls so that the player can not pass through them. This leads to the player's head colliding on the bottom of the wall, like so:
In the image, the player can not move forward any more.
My solution to this, would be to place the bounding box around the player's feet. However, this would interfere with my alpha-based system, and other collision systems (enemies hitting the player, etc.)
How should I approach this?
If my question is unclear, I can provide more images and descriptions of what I'm trying to achieve.