A downloadable library
fuwafuwa is a timer system for GameMaker Studio 2 designed to be 1. as simple to use as possible and 2. banish "alarms" to the depths of hell. We use it internally for our projects but have made it available as a separate open-source library.
fuwafuwa was made for GMS 2.2.5, but works in 2.3.0+ as well. If you run into problems in 2.3.0+, please re-import the asset package and try again, as the importer seems to break and wipe functions occasionally (this isn't a fuwafuwa thing, just a GMS thing).
- Simple syntax: Once you've created a timer, just pass it to
timer_checkin your Step event to check if it's gone off. You can create timers in frames, milliseconds, seconds, or the latter two but frame-locked.
- Pausing and resuming timers: Timers can be paused, resumed, or restarted at any time. You can also create stopped timers in advance and resume them later when you need them.
- Access and modify lots of timer information: Get how long a timer's run, the time remaining, how many times it's completed, change its duration, time-shift it, and more. All functions that return or require a time value automatically use the unit you set for the timer in the first place, doing conversion as necessary.
- Repeating and sequential timers: Timers can be set to repeat, either with a single time (e.g. repeat every 5 seconds) or a sequence of time values (e.g. set a timer for 5 seconds, followed by one for 10 seconds). This functionality seamlessly integrates with
timer_check. You can check whether the current sequence has completed, and append additional nodes to the timer sequence.
- Ping-pong support: Timers can be set to invert their values every time they repeat or restart, useful for symmetrical animations, etc.
- Normalized progress, easings, and easing downsampling: You can check the normalized progress of a timer (from 0-1), but if you set an easing function, you can also track its progress along that easing function. If you don't like a smooth look, change how often the function is sampled by setting the timer's ease interval.
- Script support: Timers can run a script on completion, timer resume, or timer halt in any instance scope.
- Fully documented: The fuwafuwa wiki contains a full list of functions and some tutorials, and a basic example project is downloadable below.
fuwafuwa is published under the MIT License, and includes these easing functions under BSD license.
Please view the setup guide for installation and initialization instructions.