public void travel(double dt)
{
  //Arr is an array that contains all the balls except the cue ball
  //so each time all the balls are checked if the cueball has collided with them
  for (int i = 0; i < Arr.size(); i++)
  Arr.getBallAt(i).collision(cueBall);

  //cueBall moves from its initial position
  cueBall.travel(dt);

  //the method travel is called on all the other balls and they will only move if their velocities is not 0
  for (int i = 0; i < Arr.size(); i++)
  Arr.getBallAt(i).travel(dt);

  for (int i = 0; i < Arr.size(); i++)
  ballMoved = cueBall.check(Arr.getBallAt(i));

  repaint();
}