Skip to content

A simple managed callBack scheduler. Use as an alternative to setTimeout.

License

Notifications You must be signed in to change notification settings

treefortress/Delay.call

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

CallLater

An alternative to setTimeout, which gives you control over the time elapsed, and ability to easily remove scheduled calls.

It also provides convenience methods for clearing all existing Calls, for example, when your player has died, you might want to release any pending calls.

View Source Code

USAGE

Basic Usage

  • CallLater.add(myFunction, 1000, [arg1, arg2]);
  • CallLater.remove(myFunction);

Updating

CallLater is updated manually, you pass in the time elapsed, giving you full control:

  • CallLater.update(deltaTime);

Perhaps your game has a slowMotion mode, you can have all callbacks take that into effect:

  • CallLater.update(deltaTime * Game.slowFactor);

License

WTFPL

About

A simple managed callBack scheduler. Use as an alternative to setTimeout.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published