Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Game.prototype.timer = function(seconds, callback) {
- seconds || (seconds = 5)
- var timerInterval = setInterval(function() {
- if (--seconds==0) {
- callback();
- clearInterval(timerInterval);
- }, 1000*seconds);
- }
- }
Add Comment
Please, Sign In to add comment