I was hoping to find some guidance on top down collision for interior terrain such as this:
I don't think my game would be highly that complex regarding clutter on the game area, but I do imagine there will be sufficient amounts of walls and boxes for players to collide with. How would I go about coding something like this?
Would Box2D be able to do something like this? I haven't messed with that yet.
Box2D is a full physics engine, it might be able to do this but it'll do a lot of other stuff as well. I'm also not sure if Box2D even works with a top down approach...
You probably need a collision detection engine like HardonCollider or maybe Bump if you're mostly working with rectangles like your example image.
Those can detect collisions for you, and you can add your own logic for resolving them (for bumping into walls, mostly just moving the player backwards a bit)
Plu wrote:Box2D is a full physics engine, it might be able to do this but it'll do a lot of other stuff as well. I'm also not sure if Box2D even works with a top down approach...
You probably need a collision detection engine like HardonCollider or maybe Bump if you're mostly working with rectangles like your example image.
Those can detect collisions for you, and you can add your own logic for resolving them (for bumping into walls, mostly just moving the player backwards a bit)
You know the funny thing is I have seen HardonCollider mentioned literally dozens of times but I never knew it was for collisions. I'll check it out.
I used the box2d mappings in my game, which is also a top-down, so I can say for certain that love.physics can certainly accomplish what you want. You need to either build a bunch of edge shapes (that's what I'm using in my game) or polygon shapes (cannot be concave, no more than 8 points)
That said, you may not need something so heavyweight considering your needs.