Twerp - Script for GMS2
Twerp is an easing function for GameMaker Studio 2 that functions similar to the lerp() function, but allows you to select from many easing algorithms to augment how the value changes over time.
Here is how I typically use twerp:
You need 4 things to start, often defined in the create event.
1. A start value.
2. An end value.
3. A length for the transition from start to end (typically in steps)
4. And a timer to keep track of how long the current transition has been going.
So my create event might look like this:
timer = 0; length = room_speed * 2; start = 50; end = 150;
Then my Step Event:
timer++; x = twerp(TwerpType.inout_cubic, start, end, timer / length);
And it's really that simple.
Status | Released |
Category | Assets |
Rating | Rated 4.8 out of 5 stars (4 total ratings) |
Author | Pixelated Pope |
Made with | GameMaker: Studio |
Download
Download NowName your own price
Click download now to get access to the following files:
TwerpDemoProjectSource.yyz 81 kB
twerp.gml 7 kB
Development log
- New Update with optional argument: loopingOct 26, 2021
Comments
Log in with itch.io to leave a comment.
Really great, but I'm honestly most impressed by this page.
Yep, me too. Still great tool tho, i am gonna use this for sure.
I'll add the demo project source to the available files for people who want to see how I did it. It's really nothing fancy.