Skip to content

Instantly share code, notes, and snippets.

@drhayes
Created January 14, 2013 06:28
Show Gist options
  • Save drhayes/4528138 to your computer and use it in GitHub Desktop.
Save drhayes/4528138 to your computer and use it in GitHub Desktop.
EventChain's wait function
update.wait = function(secs) {
var decrement = secs;
steps.push(function() {
// Update.
if (decrement) {
decrement -= ig.system.tick;
}
// End.
if (decrement <= 0) {
steps.shift();
// Necessary because of repeat.
decrement = secs;
}
});
return this;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment