public void keyPressed(KeyEvent e) {

        if (e.getKeyCode() == KeyEvent.VK_LEFT) {
            direccion = 3;                                      
            left = true;                                        

        } else if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
            direccion = 4;
            right = true;
        } else if (e.getKeyCode() == KeyEvent.VK_P) {
            pausar = !pausar;
        } else if (e.getKeyCode() == KeyEvent.VK_S) {
            sound_off = !sound_off;
        } else if (e.getKeyCode() == KeyEvent.VK_R && (vidas == 0 || lista.isEmpty())) {

            restart = true;
        } else if (e.getKeyCode() == KeyEvent.VK_I) {
            instr = !instr;
        }

    }