How do I "Ease" with formulas?

  • 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;

    };

    </font>

    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!

  • s000.tinyupload.com/index.php

    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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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" ?

  • 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!

  • 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.html

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)