js/arrangeTiles.js
// Ends the game and checks for achievement conditions
Ends the game and checks for achievement conditions
Ends the game and checks for achievement conditions
function gameOver() {
            runGameTimer(true);
            var timeTaken = getGameTimeElapsed(),
                currentBestTime = getBestTime(),
                currentBestMoves = getBestMoves(),
                newBestTime = false,
                newBestMoves = false;
            if (timeTaken < currentBestTime) {
                newBestTime = true;
                setBestTime(timeTaken);
            }
            if (currentNumMoves < currentBestMoves) {
                newBestMoves = true;
                setBestMoves(currentNumMoves);
            }
            if (newBestTime || newBestMoves) {
                saveSettings(currentSettings);
            }
            showGameOverModal(timeTaken, newBestTime, newBestMoves);
        }
function gameOver ( ) { runGameTimer ( true ) ; var timeTaken = getGameTimeElapsed ( ) , currentBestTime = getBestTime ( ) , currentBestMoves = getBestMoves ( ) , newBestTime = false , newBestMoves = false ; if ( timeTaken < currentBestTime ) { newBestTime = true ; setBestTime ( timeTaken ) ; } if ( currentNumMoves < currentBestMoves ) { newBestMoves = true ; setBestMoves ( currentNumMoves ) ; } if ( newBestTime || newBestMoves ) { saveSettings ( currentSettings ) ; } showGameOverModal ( timeTaken , newBestTime , newBestMoves ) ; }
Ends the game and checks for achievement conditions
Ends the game and checks for achievement conditions
// Save our progress if any stats changed // Display solved dialogue