public final void gameWon () {
        if (inGameState("GameWon")
            || (!inGameState("InGame") && !inGameState("LifeLost"))) return;
        gamewon=true;
        clearKey(key_continuegame);
        setFrameRate(30, 2);
        removeGameState("StartLevel");
        removeGameState("StartGame");
        removeGameState("LifeLost");
        seqtimer = 0;
        CreateEffect.Words(pfWidth()/2, pfHeight()/2, "VICTORY");
        if (gamewon_ticks > 0) {
            if (gamewon_ingame)
                addGameState("GameWon");
            else setGameState("GameWon");
            new JGTimer(gamewon_ticks, true, "GameWon") {
                public void alarm () {
                    gotoTitle();
                }
            };
        }
        else {
            gotoTitle();
        }
    }