From 461b321652558150ecffb82891b5f2899da4dc1f Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Mon, 11 May 2015 17:07:32 +0200 Subject: [PATCH] Added alert when finished --- static/js/prototype/Coin.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/js/prototype/Coin.js b/static/js/prototype/Coin.js index a510569..b8fdd33 100644 --- a/static/js/prototype/Coin.js +++ b/static/js/prototype/Coin.js @@ -41,7 +41,11 @@ Coin.prototype.get = function() { this.mesh.visible = false; Coin.total ++; Coin.nextSound.play(); - Coin.nextSound = new Audio('/static/data/music/redcoins/' + Coin.total + '.mp3'); + if (Coin.total ===9) { + alert("You got all the red coins !"); + } else { + Coin.nextSound = new Audio('/static/data/music/redcoins/' + Coin.total + '.mp3'); + } } }