Corrected Thierry's bug

This commit is contained in:
Thomas FORGIONE 2015-05-11 14:42:50 +02:00
parent fce7adb495
commit c2dd1517e5
1 changed files with 8 additions and 6 deletions

View File

@ -35,12 +35,14 @@ Coin.prototype.update = function() {
} }
Coin.prototype.get = function() { Coin.prototype.get = function() {
if (!this.got) {
this.got = true; this.got = true;
this.mesh.visible = false; this.mesh.visible = false;
Coin.total ++; Coin.total ++;
var sound = new Audio('/static/data/music/redcoins/' + Coin.total + '.mp3'); var sound = new Audio('/static/data/music/redcoins/' + Coin.total + '.mp3');
sound.play(); sound.play();
console.log(sound) console.log(sound)
}
} }
Coin.total = 0; Coin.total = 0;