Created
July 10, 2013 02:32
-
-
Save nklsrh/5963007 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
// if ball goes off the 'left' side (Player's side) | |
if (ball.position.x <= -fieldWidth/2) | |
{ | |
// CPU scores | |
score2++; | |
// update scoreboard HTML | |
document.getElementById("scores").innerHTML = score1 + "-" + score2; | |
// reset ball to center | |
resetBall(2); | |
// check if match over (someone scored maxScore points) | |
matchScoreCheck(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment