PDA

View Full Version : Game of billiards


winmac
03-28-2002, 08:37 AM
Hello everyone,
I saw a dazzling game of billiards on flashacademy.com(experiment section). I have been able to make most of it except the collision(of balls) and rebounding in such a way that it looks o real.


They haven't made the source code available. plz help me do this advanced collision.

thanx in advance.

sfa
03-28-2002, 08:57 AM
The concept is basically this. When the balls hit (using hitTest), you need to calculate a couple of thigs. I suppose you would know how to bounce the ball at different angles off a straight line. Basically when you do that you get the angle at which the ball hits the straight line and calculate the same angle on the other side of a right angle to the streight line. Now basically the right angle from the straight line in this case would be the line between the center of the ball you are bouncing against and the center of the ball in question. Then do the same as you would on a straght line.

Did you understand the concept.

SFA