Basic Collision Detection

DeBusk, Jonathan Thomas DeBuskJT at wofford.edu
Tue Jan 28 07:10:54 PST 2003


I've been working for the past few weeks on a very basic billiards game
that requires collision detection. While I can "bounce" off the sides of
the table just fine, I'm having real trouble getting two balls to "see"
one another and collide. I can't quite grasp how it should be done w/o
some sort of brute force method where each ball checks to see if it
currently colliding with every other ball.

This way seems inefficient and requires a lot of work... plus I can
never seem to figure out WHERE I should actually be detecting the
collision (should the game sort of work this out, or should balls be
responsible for their own collision detection?).

At this stage, I don't need it to be very realistic, I just want it to
work. Has anyone worked out a similar problem before (or seen code that
does something similar in Smalltalk/Squeak)? Is there any advice anyone
can give me?

Thanks.




More information about the Squeakland mailing list