wTimer v2.1.3

wTimer is a library that offers a more robust alternative for GameMaker's built-in alarms.

API Reference | GitHub

With this library, you can create timers that run a specific function after a certain amount of time. This is very similar to GameMaker's built-in alarms, but instead of relying on separate actions, you can just use your own methods, meaning you can declare timers and what they do in a single script, or even a single line if you so choose!

The usage of this library is very similar to Javascript's "setInterval()" and "setTimeout()" methods, so if you're familiar with those then you should feel right at home.

This library was only tested on Windows, HTML5, and GXC targets, but it should work on other platforms as well. It also comes with an example project that will show you the basics.

Since I made this library primarily for my own personal projects, I will keep updating it on a regular basis.

This library is made by Mors (Website | Patreon).

Basic Usage

callback = function() {
    show_message("Pretty cool, huh?");
}
timer(callback, 300);
timer(function(){show_message("Forever repeating timer.");}, 60, true);

To learn about how to use the individual functions please give the API Reference a look.

License

The main script for the library (the "scr_wtimer.gml" file) is licensed under MPL 2.0. You can learn more about it here, with Q8 being the most relevant part for most game developers. The rest of the repository is licensed under public domain.

Changelog

You can view the full changelog on GitHub.


If you have any questions, you can ask them in the comments section down below, or create an issue in this library's GitHub repository.

StatusReleased
CategoryAssets
Rating
Rated 5.0 out of 5 stars
(1 total ratings)
AuthorMors
Made withGameMaker
Tagsalarm, GameMaker, timer
Code licenseMozilla Public License 2.0 (MPL)

Download

Download NowName your own price

Click download now to get access to the following files:

scr_wtimer.gml 20 kB
wTimer.yyz 87 kB

Development log

View all posts

Leave a comment

Log in with itch.io to leave a comment.