private void mapIsComplete(AbstractAgent agent) {
        if (agent.isDead || agent.isVictorious) {
            String label = "";
            mapCompleted = true;

            if (agent.isDead) {
                label = "isDead";

                agentSprite.setAnimation("die");
                victoryCondition = -1;
                dieSprite.isVisible = true;
                if (config.isMIDI_PLAY()) {
                    midi.load("sounds/gameOver.mid");
                    midi.play(true);
                    midi.loop(0);
                }
            }
            if (agent.isVictorious) {
                label = "isVictorious";
                agentSprite.isVisible = false;
                if (agent.hasGold) {
                    label += " hasGold";

                    victoryCondition = 2;
                    midi.stop();
                    Sound victory = new Sound("main/resources/sounds/mmVictory.wav");
                    victory.play();
                    winSprite.isVisible = true;
                } else {
                    label += " hasNoGold";
                    victoryCondition = 1;
                    loseSprite.isVisible = true;
                }
            }

            final GameState gameState = getGameState(agent);

            gameState.map = wumplusEnvironment.getMapName();
            new Runnable() {
                @Override
                public void run() {
                    JFrame frame = new ResultFrame(gameState);
                    frame.pack();
                    frame.setVisible(true);
                }

            }.run();


        }
    }