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

For questions about using Classic.

### » Wed Jun 08, 2016 8:35 pm

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)

Many thanks for your help in advance!

Cheers,

// izioq //
B
4
S
1
Posts: 26
Reputation: 384

### » Thu Jun 09, 2016 12:25 am

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
B
53
S
24
G
70
Posts: 1,201
Reputation: 41,430

### » Thu Jun 09, 2016 7:24 am

Thanks for your quick reply I'll check that !

However I would be very glad if someone could help me regarding my question about sine behaviour because I really would like to know how to solve it as well.

@tulamide any ideas ?

Thanks!
B
4
S
1
Posts: 26
Reputation: 384

Return to Help & Support using Construct Classic

### Who is online

Users browsing this forum: No registered users and 1 guest