This commit is contained in:
Thomas FORGIONE 2015-08-28 17:35:29 +02:00
parent 6ee9e6e47e
commit f136ce833f
3 changed files with 25 additions and 6 deletions

View File

@ -183,6 +183,10 @@ Coin.prototype.get = function() {
if (!this.got) { if (!this.got) {
this.got = true; this.got = true;
if (typeof Coin.onCoinGot === 'function') {
Coin.onCoinGot(Coin.total + 1);
}
// Call the callback if any // Call the callback if any
if (this.callback) if (this.callback)
this.callback(); this.callback();

View File

@ -27,12 +27,16 @@ window.onbeforeunload = function() {
}; };
setTimeout(function() { Coin.onCoinGot = function(coin) {
$('#next').show(); if (coin === 6) {
$('#next').click(function() { setTimeout(function() {
window.location = '/prototype/games'; $('#next').show();
}); $('#next').click(function() {
}, 3*60*1000); window.location = '/prototype/games';
});
}, 60*1000);
}
};
function main() { function main() {

View File

@ -18,6 +18,17 @@ var pointer;
var startCanvas; var startCanvas;
var tutorial; var tutorial;
Coin.onCoinGot = function(val) {
if (val === 6) {
setTimeout(function() {
$('#next').show();
$('#next').click(function() {
window.location = '/prototype/games';
});
}, 60*1000);
}
};
function main() { function main() {
// Main container that holds everything // Main container that holds everything