public void move(Player right, Player left){
        xLoc+=xVel;
        yLoc +=yVel;
        
        //bounces off the top of the playing field
        if(yLoc<5){
            yLoc = 10-yLoc;
            yVel = -yVel;
        }
        //bounces off the bottom of the playing field
        if(yLoc>495){
            yLoc = 990-(yLoc);
            yVel = -yVel;
        }
        //bounces off the right Paddle
        if(xLoc<=right.getX()+Player.WIDTH/2 && xLoc>right.getX()-Player.WIDTH/2
                && Math.abs(yLoc-right.getY())<Player.LENGTH/2){
            xLoc=20+(20-xLoc);
            if(xLoc<20)
                xLoc = 20;
            xVel=-xVel;
            accelerate();
        }
        //bounces off the left Paddle
        if(xLoc>=left.getX()-Player.WIDTH/2 && xLoc<left.getX()+Player.WIDTH/2
                && Math.abs(yLoc-left.getY())<Player.LENGTH/2){
            xLoc=475-(xLoc-475);
            xVel=-xVel;
            accelerate();
        }
    }