Guest User

Untitled

a guest
Jan 23rd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. Game.prototype.timer = function(seconds, callback) {
  2. seconds || (seconds = 5)
  3.  
  4. var timerInterval = setInterval(function() {
  5. if (--seconds==0) {
  6. callback();
  7. clearInterval(timerInterval);
  8. }, 1000*seconds);
  9. }
  10.  
  11. }
Add Comment
Please, Sign In to add comment