/*
What we first add to the code is to check if the ball is actually 
going left, and if not, adjust the position of the computer paddle 
to the center, in the "ready" position.
*/

if(pongball.x_speed == 2)
{
		//the ball is going to the right
		if(computer.real_y_pos < 70)
		{
		       computer.y_pos++;
        }
        else if(computer.real_y_pos > 70)
        {
               computer.y_pos--;
        }
}

/*
Next we want to write the code for when the ball is coming at us. 
Using my "prediction" method, we can hardcode into the AI what 
general vicinity to move into when a ball is coming from a specific 
area.
*/
//so the ball is going left
else
{
     //check as to whether we should have the AI move yet -- not for a little bit
     if(pongball.x_pos < 140){  //if its less, its okay to move
          if(pongball.y_pos <= 35)
          {
               if(computer.y_pos > 25)
               {
                    computer.y_pos--;
               }
               if(computer.y_pos < 25)
               {
                    computer.y_pos++;
               }
          }
          if(pongball.y_pos > 35 && pongball.y_pos < 70)
          {
               if(computer.y_pos > 60)
               {
                    computer.y_pos--;
               }
               if(computer.y_pos < 60)
               {
                    computer.y_pos++;
               }                              
         }
         if(pongball.y_pos >= 70 && pongball.y_pos < 105)
         {
               if(computer.y_pos > 100)
               {
                    computer.y_pos--;
               }
               if(computer.y_pos < 100)
               {
                    computer.y_pos++;
               }                              
         }
         if(pongball.y_pos >= 105 && pongball.y_pos <= 140)
         {
               if(computer.y_pos > 140)
               {
                   computer.y_pos--;
               }
               if(computer.y_pos < 140)
               {
                   computer.y_pos++;
               }                              
         }
     } //end if

     //CHECK TO SEE IF BALL IS "WITHIN REACH"
     if(pongball.x_pos - computer.x_pos <= 15)  //make some minor adjustments
     {
         if((pongball.y_pos - computer.y_pos > -10) && (pongball.y_pos - computer.y_pos < 0))
              computer.y_pos--;
         if((pongball.y_pos - computer.y_pos > 00) && (pongball.y_pos - computer.y_pos < 10))
              computer.y_pos++;
     }
}

////////////////////////////////////////////////////////////////////////////////////////
My ai stuff

	void moveAI(){
		newP2PaddleY = aiPaddleLabel.getY();
		//if it is a new game set the paddle in the middle of the field on the right side
		if(newGame){
			aiPaddleLabel.setLocation(playPanel.getWidth() - 20, playPanel.getHeight() / 2);
			newGame = false;
		}
		//only move the paddle within the y bounds
		if(ballLabel.getY() > 0 && ballLabel.getY() < playPanel.getHeight() )
			//match the paddle with the x of the ball
			aiPaddleLabel.setLocation(playPanel.getWidth() - 20, ballLabel.getY() - 26);
	}



