Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » I need help with my script,
- 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]>>>How could I make so that the smooth glide takes a selected number of seconds?
change x by (((0) - (x position)) / (drag))
change y by (((0) - (y position)) / (drag))
end
Last edited by Rakono (May 12, 2024 22:43:14)
- itsDJSMG
- Scratcher
18 posts
I need help with my script,
repeat until <<not <((0) - (round (x position))) > [0]>> and <not <((0) - (round (y position))) > [0]>>>How could I make so that the smooth glide takes a selected number of seconds?
change x by (((0) - (x position)) / (drag))
change y by (((0) - (y position)) / (drag))
end
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,
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?repeat until <<not <((0) - (round (x position))) > [0]>> and <not <((0) - (round (y position))) > [0]>>>How could I make so that the smooth glide takes a selected number of seconds?
change x by (((0) - (x position)) / (drag))
change y by (((0) - (y position)) / (drag))
end
Probably by changing the number zero or changing drag value.
Last edited by Rakono (May 13, 2024 12:26:25)
- Discussion Forums
- » Help with Scripts
- » I need help with my script,