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.  

StatusReleased
CategoryAssets
Rating
Rated 5.0 out of 5 stars
(4)
AuthorPixelated Pope
Made withGameMaker: 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

Comments

Log in with itch.io to leave a comment.

(+5)

Really great, but I'm honestly most impressed by this page.

(+4)

Yep, me too. Still great tool tho, i am gonna use this for sure.

(+4)

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.