function startNextLevel() {
    if (currentLevel.length == 4) {
        finalCount += 1
    }
    currentLevelNum += 1
    flicker()
    if (currentLevelNum < numLevels) {
        currentLevel = gameLevels[currentLevelNum]
        runLevel(currentLevel)
    } else {
        endGame = true
        ctx.clearRect(0, 0, canvas.width, canvas.height)
        setBackground('#000000')
        document.getElementById('interface').style.backgroundColor = '#000000'
        XButton.style.display = 'none'
        YButton.style.display = 'none'
        openMenuButton.style.backgroundColor = '#000000'
        openMenuButton.style.boxShadow = 'none'
        openMenuButton.style.border = 'none'
        openMenuButton.style.color = '#ffffff'
    }
}
// starts next level and ends the game
starts next level and ends the game
starts next level and ends the game
function startNextLevel() {
    if (currentLevel.length == 4) {
        finalCount += 1
    }
    currentLevelNum += 1
    flicker()
    if (currentLevelNum < numLevels) {
        currentLevel = gameLevels[currentLevelNum]
        runLevel(currentLevel)
    } else {
        endGame = true
        ctx.clearRect(0, 0, canvas.width, canvas.height)
        setBackground('#000000')
        document.getElementById('interface').style.backgroundColor = '#000000'
        XButton.style.display = 'none'
        YButton.style.display = 'none'
        openMenuButton.style.backgroundColor = '#000000'
        openMenuButton.style.boxShadow = 'none'
        openMenuButton.style.border = 'none'
        openMenuButton.style.color = '#ffffff'
    }
}
function startNextLevel ( ) { if ( currentLevel . length == 4 ) { finalCount += 1 } currentLevelNum += 1 flicker ( ) if ( currentLevelNum < numLevels ) { currentLevel = gameLevels [ currentLevelNum ] runLevel ( currentLevel ) } else { endGame = true ctx . clearRect ( 0 , 0 , canvas . width , canvas . height ) setBackground ( '#000000' ) document . getElementById ( 'interface' ) . style . backgroundColor = '#000000' XButton . style . display = 'none' YButton . style . display = 'none' openMenuButton . style . backgroundColor = '#000000' openMenuButton . style . boxShadow = 'none' openMenuButton . style . border = 'none' openMenuButton . style . color = '#ffffff' } }
starts next level and ends the game
starts next level and ends the game