Discuss Scratch

Rakono
Scratcher
49 posts

I need help with my script,

repeat until <<not <((0) - (round (x position))) > [0]>> and <not <((0) - (round (y position))) > [0]>>>
change x by (((0) - (x position)) / (drag))
change y by (((0) - (y position)) / (drag))
end
How could I make so that the smooth glide takes a selected number of seconds?

Last edited by Rakono (May 12, 2024 22:43:14)

itsDJSMG
Scratcher
18 posts

I need help with my script,

Rakono wrote:

repeat until <<not <((0) - (round (x position))) > [0]>> and <not <((0) - (round (y position))) > [0]>>>
change x by (((0) - (x position)) / (drag))
change y by (((0) - (y position)) / (drag))
end
How could I make so that the smooth glide takes a selected number of seconds?

Probably by changing the number zero or changing drag value.

Owner of the most pointless scratch projects and ideas. Enjoys occasionally looking at forums.
Rakono
Scratcher
49 posts

I need help with my script,

itsDJSMG wrote:

Rakono wrote:

repeat until <<not <((0) - (round (x position))) > [0]>> and <not <((0) - (round (y position))) > [0]>>>
change x by (((0) - (x position)) / (drag))
change y by (((0) - (y position)) / (drag))
end
How could I make so that the smooth glide takes a selected number of seconds?

Probably by changing the number zero or changing drag value.
0 is the desired position so not that. Basically each frame the sprite slows down (because it keeps getting divided by drag). By what number do I have to divide so that it takes exactly (selected seconds) to travel to the desired coordinates?

Last edited by Rakono (May 13, 2024 12:26:25)

Powered by DjangoBB