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) {
this.got = true;
if (typeof Coin.onCoinGot === 'function') {
Coin.onCoinGot(Coin.total + 1);
}
// Call the callback if any
if (this.callback)
this.callback();

View File

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

View File

@ -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