Hello everyone,
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.
Need Guidance: Top-Down Floor-plan collision for walls
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- severedskullz
- Prole
- Posts: 36
- Joined: Thu May 30, 2013 1:55 am
Re: Need Guidance: Top-Down Floor-plan collision for walls
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 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)
- severedskullz
- Prole
- Posts: 36
- Joined: Thu May 30, 2013 1:55 am
Re: Need Guidance: Top-Down Floor-plan collision for walls
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.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)
Re: Need Guidance: Top-Down Floor-plan collision for walls
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.
That said, you may not need something so heavyweight considering your needs.
Who is online
Users browsing this forum: No registered users and 12 guests