diff --git a/js/l3d/apps/prototype/Coin.js b/js/l3d/apps/prototype/Coin.js index ce22280..75caeed 100644 --- a/js/l3d/apps/prototype/Coin.js +++ b/js/l3d/apps/prototype/Coin.js @@ -183,6 +183,10 @@ Coin.prototype.get = function() { if (!this.got) { this.got = true; + if (typeof Coin.onCoinGot === 'function') { + Coin.onCoinGot(Coin.total + 1); + } + // Call the callback if any if (this.callback) this.callback(); diff --git a/js/l3d/apps/prototype/interactive/main.js b/js/l3d/apps/prototype/interactive/main.js index f1d5c07..d18cf4d 100644 --- a/js/l3d/apps/prototype/interactive/main.js +++ b/js/l3d/apps/prototype/interactive/main.js @@ -27,12 +27,16 @@ window.onbeforeunload = function() { }; -setTimeout(function() { - $('#next').show(); - $('#next').click(function() { - window.location = '/prototype/games'; - }); -}, 3*60*1000); +Coin.onCoinGot = function(coin) { + if (coin === 6) { + setTimeout(function() { + $('#next').show(); + $('#next').click(function() { + window.location = '/prototype/games'; + }); + }, 60*1000); + } +}; function main() { diff --git a/js/l3d/apps/prototype/tutorial/main.js b/js/l3d/apps/prototype/tutorial/main.js index e2f3091..905efc4 100644 --- a/js/l3d/apps/prototype/tutorial/main.js +++ b/js/l3d/apps/prototype/tutorial/main.js @@ -18,6 +18,17 @@ var pointer; var startCanvas; var tutorial; +Coin.onCoinGot = function(val) { + if (val === 6) { + setTimeout(function() { + $('#next').show(); + $('#next').click(function() { + window.location = '/prototype/games'; + }); + }, 60*1000); + } +}; + function main() { // Main container that holds everything