Asset - Scripts GMTwerk 2: Delay actions and animate values with ease

FrostyCat

Member
GMTwerk 2
Delay actions and animate values with ease

Overview

GMTwerk 2 allows you to set delays, listen to conditions and animate values asynchronously using a fire-and-forget interface. One GMTwerk 2 actor can replace alarms, timelines and many kinds of step event code in a compact, at-source form. Focus on what you want to do, not how to continue it in future steps — and smooth out your animations with unprecedented ease along the way.

Downloads / Links
GitHub: Link | Repository | Wiki
YoYo Marketplace: Link

Quick Starters

Execute an action after 1 second

GML:
Delay(1000, function() {
    show_message("Time's up!");
});
Animate a value and then execute an action
GML:
Tween(InstanceVar("image_alpha"), 0, 500, [
    "onDone", function() {
        instance_destroy();
    }
]);
Execute an action when a condition becomes satisfied later
GML:
WhenTrue(function() {
    return bbox_top > room_height;
}, function() {
    show_message("You fell!");
});
Feedback Welcome!
If you have any suggestions for new actors/use cases or bug reports, please open an issue or contribute on GitHub.
 
Last edited:

Toque

Member
I will have to try this. Probably one of the only projects I actually understand. Haha.
Thanks
 

Amon

Member
Cool. I have a use for this. I want to see if I can replace my 'when all instances stop moving - do this" code.
 

dadio

Lemon Overlord
Forum Staff
Moderator
This is neat. (As an animator this is really convenient.) Keep up the great work FrostyCat!
Side note: Happy to have you still around on the forums. Many folks seem to have fallen (or been pushed) off the GMC train at this stage, glad you're not among them. Your efforts and input are always appreciated!
 

samspade

Member
It's very cool. Initial thoughts:
  • The basic stuff is really easy to figure out and use. I had no issues getting things like Delay, Repeat, ForEach, and so on to work.
  • I couldn't figure out anything beyond the basic tween twerk functions. I figured out the twerk using the tween example provided but I couldn't get the anim channels to work or figure out how to use any of the tween settings. I think more examples here would be helpful.
  • I couldn't really figure out how to use optional arguments. (The wiki examples seem to be outdated here)
  • The name is slightly confusing. While I know what tweening is, I don't really know what twerking is (if you're not referring to the dance) even after Googling it. Additionally, it is confusing having all of the scripts named GMTwerk when most of them don't have anything to do with twerking.
 
Top