Discuss Scratch

Greenie_WasTaken
Scratcher
11 posts

Glide Block Formula?

So, I've been trying to make a timer script that uses a variable to act as an X position that glides across the screen for a specific duration. However, I've done many google searches for the glide block formula and I can't find the glide block formula, which is ESSENTIAL for this. Can you help me?

Last edited by Greenie_WasTaken (Aug. 15, 2023 12:39:35)

ajskateboarder
Scratcher
1000+ posts

Glide Block Formula?

If it helps, here is the JavaScript code which is used to calculate gliding
Greenie_WasTaken
Scratcher
11 posts

Glide Block Formula?

ok lol
-Valtren-
Scratcher
1000+ posts

Glide Block Formula?

Is this what you're looking for?

keep in mind it uses variables.
imfh
Scratcher
1000+ posts

Glide Block Formula?

-Valtren- wrote:

Is this what you're looking for?
-image-
keep in mind it uses variables.
That doesn’t look right. Why is the Z position changed based on the size? The glide block doesn’t change the layer the sprite is on.

Last edited by imfh (Aug. 15, 2023 14:07:53)

D-ScratchNinja
Scratcher
1000+ posts

Glide Block Formula?

Here's something I made if you want: https://scratch.mit.edu/projects/653271210/

It includes easing patterns for a sine wave in, out, or both. And if you don't specify, it should work the same as the built-in glide block.
-Valtren-
Scratcher
1000+ posts

Glide Block Formula?

imfh wrote:

-Valtren- wrote:

Is this what you're looking for?
-image-
keep in mind it uses variables.
That doesn’t look right. Why is the Z position changed based on the size? The glide block doesn’t change the layer the sprite is on.
In this case Z = size.
Greenie_WasTaken
Scratcher
11 posts

Glide Block Formula?

As a reminder, I do not want the fanmade smooth glides. I'm making a timer, I want a linear gliding animation
-Valtren-
Scratcher
1000+ posts

Glide Block Formula?

Greenie_WasTaken wrote:

As a reminder, I do not want the fanmade smooth glides. I'm making a timer, I want a linear gliding animation

This should work.
D-ScratchNinja
Scratcher
1000+ posts

Glide Block Formula?

Greenie_WasTaken wrote:

As a reminder, I do not want the fanmade smooth glides. I'm making a timer, I want a linear gliding animation
The project I shared includes a linear glide option, FYI.

Powered by DjangoBB