@Override
    public void keyPressed(KeyEvent e) {
        if (e.getKeyCode() == KeyEvent.VK_LEFT) {
            canasta.setMoveLeft(true);
        } else if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
            canasta.setMoveRight(true);
        } else if (e.getKeyCode() == KeyEvent.VK_P) {
            if (!pausa) {
                pausa = true;
                pelota.freeze();
            } else {
                pausa = false;
                pelota.unfreeze();
            }
        } else if (e.getKeyCode() == KeyEvent.VK_C) {

            try {
                leeArchivo();
            } catch (IOException ex) {
                Logger.getLogger(JFrameTiroParabolico.class.getName()).log(Level.SEVERE, null, ex);
            }
        } else if (e.getKeyCode() == KeyEvent.VK_S) {
            sound = !sound;
        }

    }