Skip to content

Latest commit

 

History

History
12 lines (10 loc) · 763 Bytes

README.md

File metadata and controls

12 lines (10 loc) · 763 Bytes

Timers

An implementation of both setTimeout and setInterval from JS in GameMaker Studio 2.3

Usage

  1. Copy setTimeout, setInterval, and setManager into your project
  2. Create an instance of the setManager at game start (alternatively, call __INTERVAL_UPDATE__ and __TIMEOUT_UPDATE__ every frame)
  3. Create an timeout or interval using setTimeout/setInterval respectively
  4. Use clearTimeout/clearInterval to stop them from running

Extra

  • Callback functions have an arguments variable which is an array of arguments that are passed to the callback from the inital setTimeout/setInterval functions
  • setTimeout/setInterval return a numerical ID which can be passed into clearTimeout/clearInterval to stop them from running