Timeline for Collision Detection Code Structure with Sloped Tiles
Current License: CC BY-SA 3.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 3, 2013 at 4:12 | comment | added | Sean Middleditch | That is what you just asked for. Either you collide in the center point only, like your illustration and problem indicates you want, or you collide on multiple points (possibly the whole edge, either on an AABB around the whole sprite or an AABB that is only around the "core" of the sprite). You could also use multiple hot-points per side. Real Games(tm) have done this exact technique. | |
| Nov 2, 2013 at 22:20 | comment | added | ProgrammerGuy123 | So... if I switched to a hot-point system then only the tile that the point is in would be considered for a collision? | |
| Nov 2, 2013 at 21:49 | comment | added | Sean Middleditch | If you only want the center point to be the bottom, only collide with the center point. You don't have to be a box if that's not the collision shape you want. You could use a hot-point kind of system where you have points on the sides that detect horizontal collisions and then points on the bottom and top for vertical collisions, and just place them where you find most appropriate. You could have the points on the horizontal edges 25% of the height away from the top/bottom and then the vertical points right in the middle of their edges. | |
| Nov 2, 2013 at 21:31 | comment | added | ProgrammerGuy123 | So don't preform collisions detection on inner edges, but do on outer edges? This would still cause problems here is one scenario. i.imgur.com/DooHPOJ.png The player's Y position would jump up to the top of the square tile. I guess I could just mark that as an inner edge so nothing would happen? | |
| Oct 27, 2013 at 19:01 | history | answered | Sean Middleditch | CC BY-SA 3.0 |