From c2dd1517e516a1072f42c683ee425a0f8a48e583 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Mon, 11 May 2015 14:42:50 +0200 Subject: [PATCH] Corrected Thierry's bug --- static/js/prototype/Coin.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/static/js/prototype/Coin.js b/static/js/prototype/Coin.js index 6a12cb7..eafcfe5 100644 --- a/static/js/prototype/Coin.js +++ b/static/js/prototype/Coin.js @@ -35,12 +35,14 @@ Coin.prototype.update = function() { } Coin.prototype.get = function() { - this.got = true; - this.mesh.visible = false; - Coin.total ++; - var sound = new Audio('/static/data/music/redcoins/' + Coin.total + '.mp3'); - sound.play(); - console.log(sound) + if (!this.got) { + this.got = true; + this.mesh.visible = false; + Coin.total ++; + var sound = new Audio('/static/data/music/redcoins/' + Coin.total + '.mp3'); + sound.play(); + console.log(sound) + } } Coin.total = 0;