How do you make a smooth Sine Magnitude from 55 to 30, without caging? IMG

0 favourites
  • 3 posts
From the Asset Store
30 high-quality 2D monsters. This asset is perfect for a side scrolling game, or even a turn based RPG type game.
  • Hey guys!!!

    I make this, but whem it back to speed 50 it's not smooth.

    Any idea?

    https://i.imgur.com/x9BIJuf.jpg

  • I'm guessing the sprint "teleports" and isn't smooth because you increment or decrease the amplitude instantly. If you want it to be smooth, you need to increment the amplitude gradually over time.

    One way to do this would be the following:

    Add an instance variable to camel called: myAmplitude

    • - When camel is touched and is not bujasie:
    • --- Set camel's myAmplitude to 55
    • --- Wait 3 seconds
    • --- Set camel's myAmplitude to 30
    • - Every tick:
    • --- Set camel's sine amplitude to : lerp(camel.sine.amplitude, camel.myAmplitude, 0.1)

    The trick here is the use of lerp(). I encourage you to look on this forum for example of magic lerp can do!

    (Note: I don't know what "bujasie" means so apologize if I misunderstood the whole problem.)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • (Note: I don't know what "bujasie" means so apologize if I misunderstood the whole problem.)

    wow this is cool man

    thank you!!

    ps. buja się its in polish - he is swinging (on a swing) ;-)

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