Added alert when finished

This commit is contained in:
Thomas FORGIONE 2015-05-11 17:07:32 +02:00
parent 53c630554c
commit 461b321652
1 changed files with 5 additions and 1 deletions

View File

@ -41,9 +41,13 @@ Coin.prototype.get = function() {
this.mesh.visible = false;
Coin.total ++;
Coin.nextSound.play();
if (Coin.total ===9) {
alert("You got all the red coins !");
} else {
Coin.nextSound = new Audio('/static/data/music/redcoins/' + Coin.total + '.mp3');
}
}
}
Coin.total = 1;
Coin.BASIC_MESH = null;