public void keyPressed(KeyEvent e)
      {
         if(e.getKeyCode() == KeyEvent.VK_UP)
         {keys[0]=true;}
         
         if(e.getKeyCode() == KeyEvent.VK_RIGHT)
         {keys[1]=true;}
                   
         if(e.getKeyCode() == KeyEvent.VK_DOWN)
         {keys[2]=true;}
         
         if(e.getKeyCode() == KeyEvent.VK_LEFT)
         {keys[3]=true;}
      	
         if(e.getKeyCode() == KeyEvent.VK_SPACE)
         {keys[4]=true;}          }