forum

Linearly increase speed of movement or rotation?

posted
Total Posts
3
Topic Starter
octagonal
This might be a little hard to understand because I suck at expressing myself, but I'll try:

Is it possible to linearly increase the speed of sprite movement or rotation?
Let's say I have a sprite that moves for five seconds. In the first frame, it will move at 10 pixels per second. In the last frame, it will move at 20 pixels per second. Inbetween, movement speed linearly increases from 10 to 20: 10.2pps at 0.1 seconds, 12.5pps at 1.25 seconds, 15pps at 2.5 seconds, you get the idea.
Is this type of movement possible without hardcoding every single frame of it?
Starrodkirby86
Probably the easiest way without needing to make your own velocity function would be to apply an easing motion to the sprite.

By default, all sprites interpolate smoothly (on in a linear fashion):


But sometimes we want excitement! The following is an example when applying Easing 19, OutExpo:


While the curves end up demonstrating a kind of "braking" effect at the end, you can probably work around that by changing the duration or the location it needs to go. Either way, it certainly spices things up.

If you don't mind .gifs loading, here's a page about easing if you'd like to see all 35 of them in action.
Topic Starter
octagonal
But easings all start with 0 velocity, right? In that case, they won't produce the animation I need.
Please sign in to reply.

New reply