@Override
    public void keyReleased(KeyEvent e) {
        int key = e.getKeyCode();
        if (key == KeyEvent.VK_RIGHT || key == KeyEvent.VK_LEFT) {
            cont = false;
            doubleCount++;
            startTime = System.currentTimeMillis();
        }
        previousKey = dir;
        if (key == KeyEvent.VK_RIGHT || key == KeyEvent.VK_LEFT || key == KeyEvent.VK_SPACE) {
            if (jump > 0) {
                //Continue jump animation
                model.setDirection(3);
            } else {
                //Standing still animation
                model.setDirection(0);
            }
            //Stop movement
            if (!cont) {
                dir = 1;
            } else {
                dir = tempKey;
            }
        } else {
            doubleCount = 0;
        }
    }