title: Ai/Computer player for a simple Pong Game
body: <p>Ok, Ive just finished writing my pong game, but now I want an AI for players to play against.
  Ive tried doing this by making it so that, when the location of the NPC padel is more than the Y co-ords of the ball, it moves to the right area to try and block the ball.
  Here is the code for my padel Class:</p>
  
  <pre><code>    import java.awt.event.KeyEvent;
  import java.awt.event.KeyListener;
  
  
  public class Padel implements KeyListener{
      private Ball ball = new Ball();
      private boolean LeftPlayerUp=false;
      private boolean LeftPlayerDown=false;
      private boolean RightPlayerUp=false;
      private boolean RightPlayerDown=false;
      public int RightLocation=200;
      public int LeftLocation=200;
  
      public void keyPressed(KeyEvent e){
          int KeyPressed = e.getKeyCode();
  
          if (KeyPressed== KeyEvent.VK_W){
              LeftPlayerUp=true;
          }
          else if (KeyPressed==KeyEvent.VK_S){
              LeftPlayerDown=true;
          }
      }
      public void keyReleased(KeyEvent e){
          int KeyReleased = e.getKeyCode();
  
          if (KeyReleased== KeyEvent.VK_W){
              LeftPlayerUp=false;
          }
          else if (KeyReleased==KeyEvent.VK_S){
              LeftPlayerDown=false;
          }
      }
      public void ShouldLeftMove(){
          if(LeftPlayerUp==true){
              if(LeftLocation==50){}
              else{
                  LeftLocation-=2;
              }
          }
          else if(LeftPlayerDown==true){
              if(LeftLocation==Main.Height-190){}
              else{
              LeftLocation+=2;
              }
          }
      }   
      public void ShouldRightMove(){
          if(ball.BallLocationY&gt;=RightLocation){
              RightPlayerUp=false;
              RightPlayerDown=true;
          }else{
              RightPlayerUp=true;
              RightPlayerDown=false;
          }
          if(RightPlayerUp==true){
              if(RightLocation==50){}
              else{
              RightLocation-=2;
              }
          }
          else if(RightPlayerDown==true){
              if(RightLocation==Main.Height-190){}
              else{
              RightLocation+=2;
              }
          }
      }   
      //This just needs to be here :P
      public void keyTyped(KeyEvent e) {}
  }
  </code></pre>
  
  <p>With this code the padel goes to about 2/3rds down the screen on the right side, then just stops moving and spaz's out.
  What am I doing wrong???</p>