Does anyone have some good logic (not necessarily code, but if you happen to have to urge to give C++ code snippets, be my guest) for collision checking? I know about the IntersectRect function from DirectX, but using that isn't enough. I was planning on moving the player back to a previous position if there was a collision with an enemy, but that wouldn't really work, because it is possible for a moving object (like an enemy) to have a collision with the player, in which case the enemy should move back, not the player. And I haven't though about non-moving objects. This may be simpler than I think it is, since I'm kind of tired right now, but if anyone can pitch in with their idea for this, it would be nice.
CoolGamer48
65
Posting Pro in Training
Recommended Answers
Jump to PostThis is good reference, http://www.gamasutra.com/features/19991018/Gomez_1.htm there are collision tests for different pairs of 3D objects ( see contents box on the right ). The tests would work in 2D, but, there are even simpler versions of these tests for 2D.
'Separating objects' that have collided is …
All 2 Replies
MattEvans
473
Veteran Poster
Team Colleague
Featured Poster
Ezzaral
commented:
Very good info.
+6
Phaelax
52
Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.