View Single Post
  #2 (permalink)  
Old 01-07-2008, 04:19 PM
tim's Avatar
tim tim is offline
Senior Member
 
Join Date: Dec 2007
Location: South Africa
Posts: 334
tim is on a distinguished road
Using collision detection.
Hello jaferris.

Collision detection can get tricky. First you must ask yourself:
  1. Are my objects moving fast?
  2. Are my objects complicated in shape?
If your answer is "no" to both these questions then you can simply create a box around your objects and test on a regular basis if the are intersecting. If this is false then collision detection can involve line intersection, distances and creating a "cage" around the object to handle the velocity of the object.

I have collision detection code if you need it, but it is complicated and it can slow down your game if used improperly. The best advise that I can give you is to draw pictures of your objects and solve this problem logically and mathematically.
__________________
If your ship has not come in yet then build a lighthouse.
Reply With Quote