Discuss Scratch

SpaceGames1365
Scratcher
1 post

Glide Blocks

when using

glide () secs to x: (0) y: (0)

The movement is not smooth at all and just moves the sprite there, there should be an option to change the way it move

For example: Fade in, this means that the sprite starts moving slowly then gradually speeds up
and fade out would be the same but it would slow down
there could be fade in&out making it start slow and ending slow

overall this would help make the gliding much smoother
ballyrag
Scratcher
100+ posts

Glide Blocks

What would exactly be the numbers involved to calculate the speed (just curious)? Would the “fade in” have a slight and brief “fade out” at the end, and vice versa?
zispe
Scratcher
500+ posts

Glide Blocks

One workaround for this is animating the spite using costumes, then simply using a repeat code to play those costumes in sequence.
repeat ()
next costume
end
Similarly, if you don't want to do that a longer and more annoying workaround is to put several of those blocks together to get your desired speed in the middle.
glide (1) secs to x: (-100) y: (0)
glide (.3) secs to x: (-50) y: (0)
glide (.04) secs to x: (0) y: (0)
glide (.3) secs to x: (50) y: (0)
glide (1) secs to x: (100) y: (0)
In a project, the code would be much longer than this. This is just a mockup of what it would look like.

While these are both liable options, I do agree a single block for this mechanic makes sense, and can help Scratchers make smoother animations without the headache of using long threads of block code to do what should be a simple task.
hydrofungus
Scratcher
1000+ posts

Glide Blocks

you can also always borrow the custom smooth glide blocks people have made (with credit ofc)
bubgamer072
Scratcher
97 posts

Glide Blocks

it would be cool too if you can change the easing style, with options like linear(like how it is now), sine, quadratic, elastic,etc
brybry888
Scratcher
100+ posts

Glide Blocks

I'm positive that all of these have work arounds
For example, For “Fade Out” you do
change x by (((50) - (x position) / (9))
The first value is the x position that you want to glide to. The third value is responsible for the speed. (Correct me if I'm wrong)
For “Fade In” it's the same except you are adding them dividing
change x by (((50) + (x position) / (9))
glitcX
Scratcher
1000+ posts

Glide Blocks

To glide in a different axis:
glide () steps right in () seconds ::motion
glide () steps left in () seconds ::motion
glide () steps up in () seconds ::motion
glide () steps down in () seconds ::motion
To set different easings for the glide block
set easing to [exponential v]:: motion // makes the animation of the gliding different.
glide (2) secs to x: (0) y: (0)
glide (30) steps down in (30) seconds ::motion

Last edited by glitcX (Feb. 19, 2025 03:32:00)

Powered by DjangoBB