Skip to content

Instantly share code, notes, and snippets.

@drhayes
Created January 14, 2013 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drhayes/4528006 to your computer and use it in GitHub Desktop.
Save drhayes/4528006 to your computer and use it in GitHub Desktop.
EventChain: The Basics
// Defines a function that can fire sequential events.
EventChain = function() {
// Make sure we get called with new.
if (this === window) {
return new EventChain();
}
var steps = [];
// Called every frame.
var update = function() {
if (steps && steps.length) {
steps[0]();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment