public void keyReleased(KeyEvent e) {
        keyCode = e.getKeyCode();
        if (keyCode == 38) {
            lastdir = 1;
            UP = false;
        } else if (keyCode == 40) {
            lastdir = 2;
            DOWN = false;
        } else if (keyCode == 37) {
            lastdir = 3;
            LEFT = false;
        } else if (keyCode == 39) {
            lastdir = 4;
            RIGHT = false;
        } else if (keyCode == 32) {
            tryinRun = false;
        } else if (keyCode == 90) {
            Z = false;
        } else if (keyCode == 88) {
            X = false;
        }
        keyCode = 0;
    }