Created
July 10, 2013 02:43
-
-
Save nklsrh/5963066 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// checks if either player or opponent has reached 7 points | |
function matchScoreCheck() | |
{ | |
// if player has 7 points | |
if (score1 >= maxScore) | |
{ | |
// stop the ball | |
ballSpeed = 0; | |
// write to the banner | |
document.getElementById("scores").innerHTML = "Player wins!"; | |
document.getElementById("winnerBoard").innerHTML = "Refresh to play again"; | |
} | |
// else if opponent has 7 points | |
else if (score2 >= maxScore) | |
{ | |
// stop the ball | |
ballSpeed = 0; | |
// write to the banner | |
document.getElementById("scores").innerHTML = "CPU wins!"; | |
document.getElementById("winnerBoard").innerHTML = "Refresh to play again"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment