public void keyPressed(KeyEvent e){
          int code = e.getKeyCode();
          if (code == KeyEvent.VK_RIGHT) {
               myPinko.setCurrentDirection(RIGHT);
          } else if (code == KeyEvent.VK_LEFT){
               myPinko.setCurrentDirection(LEFT);
          } else if (code == KeyEvent.VK_UP){
               if (pelletsLeft > 0){
                    myPinko.firePellet(true);
               }
          } else if (code == KeyEvent.VK_DOWN){
               if (pelletsLeft > 0){
                    myPinko.firePellet(false);
               }
          }
     }