I have a billiard ball system, whic detects collisions between balls and modifies their x and y velocities accordingly.
I have included a friction variable and I have a very basic system for applying the force of friction for each iteration of movement:
[AS]
private static var FRICTION:Number = 0.94;
…
…
public function move() : Void
{
mc._x += vx;
mc._y += vy;
vx *= FRICTION;
vy *= FRICTION;
}
[/AS]
This works to a reasonable level of satisfaction, but it doesn’t quite feel right. The balls seem to take just a little too long to stop when they’ve slowed down to a very small velocity. I’ve tried tweaking the friction constasnt, but I still can’t get sometthing that feels exactly right.
Can anyone enlighten me on a more effective method to account for friction when moving balls across a given surface?