Added ending sound

This commit is contained in:
Thomas FORGIONE 2015-05-12 10:30:29 +02:00
parent 2dccb1eede
commit bf1e6db58e
2 changed files with 3 additions and 2 deletions

Binary file not shown.

View File

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