private void DetermineBallCollision()
{
double minx = Position.X - (Radius/2);
double maxx = Position.X + (Radius/2);
double minY = Position.Y - (Radius/2);
double maxY = Position.Y + (Radius/2);
foreach (Ball ball in PongGame.Instance.Balls)
{
//Jezelf niet controleren
if (ball == this)
{
continue;
}
//De ballen raken elkaar.
if (ball.Position.X >= minx && ball.Position.X <= maxx &&
ball.Position.Y >= minY && ball.Position.Y <= maxY)
{
//TODO: Bereken hier de collision hoek
//Bereken daarna de juiste X en Y velocity
XVelocity = -XVelocity;
}
}
}