How do I "Ease" with formulas?

Get help using Construct 2

Post » Thu Nov 07, 2013 3:28 pm

hi,
i am new to variables and especially easing with math formulas.
i cant figure out how to get an easing for jumping with a figure for example...

i found this one on a page i am not permitted to paste here (if u want the link just pm me)
// quadratic easing in - accelerating from zero velocity


Math.easeInQuad = function (t, b, c, d) {
     t /= d;
     return c*t*t + b;
};

it says:
t = current time
b = start value
c = change in value
d = duration

i cant figure out how to transfer this into my event sheet in C2.

i made a global variable for each letter but dont know what to put in really :(

does somebody knows how to integrate such easing in jumping beahvior?
and how to I say Construct2 to take "2 Seconds" in realtime to do an event?
for example: do rotate sprite XYZ by 1 for 2 seconds... how would i build this in C2?

I am very thankful for any help,

greets!
B
6
S
2
G
3
Posts: 9
Reputation: 2,252

Post » Thu Nov 07, 2013 4:24 pm

http://s000.tinyupload.com/index.php?file_id=01982296062872973807

if you do +dt every tick, you will get 1 after 1 second.

Not sure how to best incorporate this into the jumping behaviour, you probably could reduce the max fall speed with a function like this.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Thu Nov 07, 2013 6:30 pm

thanks for your reply
i cant open your file :(
is there a way to downgrade the file?
i dont want the beta software to install, i prefer the stable one
so there i can be sure its me making mistakes, not the tool if something doesnt work you know?

can u explain what you mean with "dt" ?
B
6
S
2
G
3
Posts: 9
Reputation: 2,252

Post » Thu Nov 07, 2013 8:10 pm

i made the transition effect finally!
with help of many different topics here in this forum and great community help!

this one scales with easing after an overlapping or collision or which trigger you want of course

makes a zoom transition!

lerp(LayerScale(1),1.5,dt *5)

in detail:
lerp is an LinearintERPolation

(LayerScale) is normally 1
1,5 is the target // Layerscale 1,5 so to speak

and dt*5 is the factor which "motors" the movement! //dt is Delta-time in seconds

i am sitting here for hours and now its working!
thanks to everybody!
B
6
S
2
G
3
Posts: 9
Reputation: 2,252

Post » Fri Nov 08, 2013 1:08 pm

@Solano

You may find this forum post interesting - page 1 - Yann posted a great set of functions that perform various types of ease in and out

http://www.scirra.com/forum/various-ease-in-ease-out-through-functions_topic66359.htmlarontwose2013-11-08 13:09:15
B
8
S
3
G
1
Posts: 34
Reputation: 1,395


Return to How do I....?

Who is online

Users browsing this forum: georeb, part12studios and 10 guests