public void move() //class for ball motion
    {
      x += xdir; //each time the timer calls the function the x position is either increases or decreased with a set amount of pixels 
      y += ydir; //same as x

      if (x == 0) { //if the ball hits the left side of the screen its motion is changed to the right (+1x direction == right)
        setXDir(1);
      }

      if (x == BALL_RIGHT) { //if the ball hits the right side of the screen its motion is changed to the left (-1x direction == left)
        setXDir(-1);
      }

      if (y == 0) { //if the ball hits the roof of the window it is reflected towards the bottom (+1y direction == down)
        setYDir(1);
      }
    }