Easing in and out using Sine behavior

Discussion and feedback on Construct 2

Post » Sat Dec 06, 2014 5:57 am

This is an example of using Sine behavior to make truly ease-in and ease-out motion. This is not a perfect solution, rather a demo of a concept of a feature I've needed but couldn't find anywhere.

I am aware of lerp(), but I am personally couldn't find a way to use it for ease-in motion (from zero velocity to X).

Here is a link to the .capx: _https://dl.dropboxusercontent.com/u/658307/sine_easing.capx
You do not have the required permissions to view the files attached to this post.
Last edited by Kirya on Mon Dec 22, 2014 5:30 am, edited 2 times in total.
B
9
S
2
G
1
Posts: 36
Reputation: 712

Post » Sat Dec 06, 2014 5:20 pm

you may want to look at the cosp expression

https://www.scirra.com/manual/126/system-expressions

it is an interpolation, so works the same way as lerp, but the relation between the input and output values is not linear, it will be slow at first, then go faster in the middle, then slow down at the end, while reaching the value.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Sun Dec 07, 2014 6:12 am

Thank you, Aphrodite! I am definitely going to look closer at that expression you've mentioned!
B
9
S
2
G
1
Posts: 36
Reputation: 712

Post » Sun Dec 07, 2014 8:34 am

Cosp function is better and simpler for such tasks indeed! Sine behavior is no match for it :) Thank you again, Aphrodite!
B
9
S
2
G
1
Posts: 36
Reputation: 712


Return to Construct 2 General

Who is online

Users browsing this forum: Cliffu and 8 guests