How to increase layer shake relative to time passed?

What Wick Editor Version are you using?
1.19.3

Describe the Problem
I coded an image so it rotates and moves on the x and y axis by a random integer:

this.FPSCounter = 0;
this.interval = 0.000001*project.framerate;
onEvent('update', function () {
    if(this.FPSCounter++ >= this.interval) {
        this.x += random.integer(3,5,7);
        this.y += random.integer(3,5,7);
        this.x -= random.integer(3,5,7);
        this.y -= random.integer(3,5,7);
        this.rotation += random.integer(3,5,7);
        this.rotation -= random.integer(3,5,7);
        this.scaleX += 0.0025;
        this.scaleY += 0.0025;
        this.FPSCounter = 0;
    }
});

But I want the random integers to increase over time, so it gets more chaotic over time. I’m know it’s possible, but I don’t know how. Does anybody else know?

What have you tried so far?
I couldn’t figure out how to.

Do you have a Wick Editor File that we can see? Optional
Here is the wick file: Kirby put down the knife.wick (327.8 KB)

The description is still too generic… it is not possible to help you… could you describe the expected behavior a little bit more…?

Currently I have it coded so every set interval a random integer is chosen for the rotation, x movement, and y movement. I was wondering if it was possible for the possible integers’ value could increase every second?

I’m not good at explaining things lol

I think I know what you mean.

Here’s how I think it could be done:

Make two variables, min and max.
this.min=-1;
this.max=1;

Then set the x and y movement of the object to a random integer that ranges between the minimum and maximum.

this.x+=random.integer(this.min,this.max);
this.y+=random.integer(this.min,this.max);

And lastly, change the minimum and maximum values by a number

this.min-=5;
this.max+=5;

Then the object should change it’s x/y position by a value from this range

1 Like