# How can I implement collision for a “pseudo-3D” game?

I'm looking for high level implementation details, not specifics.

I've worked with bounding boxes before in some 2D games, but I'm currently tackling a "2D + depth" (2.5D?) style game along the lines of Double Dragon, Battletoads, TMNT: The Arcade Game, etc and I'm curious what a sensible collision system would be.

I think collisions between actual game objects is, for the most part, okay. I'm basically using a bounding box test that only executes if the objects' positions are within some depth threshold of each other. My real question is about collisions between floors and walls.

I want more freedom with the floors and walls than those older games listed as examples, so I've also put "mesh objects" into the game that are essentially just planes defined as combinations of triangles (simple floors also exist). The mesh objects can be static or dynamic (ie, floating platforms), and are built out of arbitrary points (ie, they are not always flat and parallel with the floor).

I can mathematically calculate collisions between objects and meshes, but I'm not sure how to go about calculating collisions between meshes themselves.

For example, how can I calculate whether two arbitrary triangles made of three arbitrary 3D points collide on a turn given position, speed, and acceleration vectors for each?

If this system sounds clumsy, I'm open to suggestions :)

• See the FAQ about what type of questions to not ask. "Which technology to use" is one of them. There isn't a really large number of engines to choose from, go through them and match them up to your requirements. – MichaelHouse Apr 23 '13 at 14:11
• I don't think this violates "What technology do I use", since I'm building a system from scratch to learn the ropes and I was curious about an underlying concept. Simply saying "use a pre-existing engine" doesn't really help, but thanks anyway. – Awesomania Apr 23 '13 at 15:59
• "Can anyone recommend a collision engine"... You aren't asking for an pre-existing engine? – MichaelHouse Apr 23 '13 at 16:08
• You are correct, this was a poorly phrased question title. I was really hoping for a solution to my problems in implementing the system as I had already imagined it, or alternatively an different "approach" to an engine design that I could implement myself for fun. Thanks. – Awesomania Apr 23 '13 at 19:16
• I've edited the question slightly, perhaps that will be enough. Though I expect the answer is something along the lines of assume it's 3D and detect collisions that way, or assume it's 2D and detect collisions that way. – MichaelHouse Apr 23 '13 at 21:03