@Override
    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_I) {
            instr = !instr;
        } else if (e.getKeyCode() == KeyEvent.VK_S) {
            sound_off = !sound_off;
        } else if (e.getKeyCode() == KeyEvent.VK_G) {
            save = true;
        } else if (e.getKeyCode() == KeyEvent.VK_C) {
            load = true;
        } else if (e.getKeyCode() == KeyEvent.VK_O) {
            inicio = true;
        } else if (e.getKeyCode() == KeyEvent.VK_SPACE) {
            salta = true;
        }

    }