# Jelly effect with sine behavior : how to sligthly slow down

This forum is currently in read-only mode.
0 Favourites
• 3 posts
• Hi there,

I'm working on a cap in order to make a simple jelly floor.

Here is my cap (sorry I can't post links because of limitations so I've removed the https : // ) : drive.google.com/open?id=0B3YMYyFd_M6dY2hIWjE3TUJPQUU

Here is my problem : in my cap, the sine behavior starts when the player is on the ball but it never stops... until the player get off the ball and then, it stops abrubtly.

I don't know how to make the sine behavior sligthly slowing down after it starts until it stops completly (and of course, starts again if the player move uppon it)

Cheers,

// izioq //

• ## Try Construct 3

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

Construct 3 users don't see these ads
• I would look at Hooke's law regarding spring physics. You can accomplish a jelly effect with that equation.

Here's a capx I made using the equation: https://onedrive.live.com/redir?resid=7 ... ile%2ccapx

I used it to create a jelly effect.

edit: oops, just noticed this is in construct classic: anyways, here's the equation:

F=-kx-cv

k: how strong the spring is.

x: the distance between objects.

c: dampening.

v: velocity of attached object.

application:

Self.vel = (-0.5*(Self.X-Sprite.X)-0.1*Self.vel)

Self.X += Self.X+Self.vel