Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Smooth glide off screen
- BestTrainerMon
- Scratcher
47 posts
Smooth glide off screen
So I want to make an Intro but I need to smooth glide offscreen. I know the smooth glide code:
But when I add the change size block to go offfscreen, It doesn't work.
define Smooth glide x:(x) y:(y) speed: (speed)
repeat until <<(round (x position)) = (round (x))> and <(round (y position)) = (round (y))>>
change x by (((x) - (round (x position))) / (speed))
change y by (((y) - (round (y position))) / (speed))
end
go to x: (x) y: (y)
But when I add the change size block to go offfscreen, It doesn't work.
define Smooth glide x:(x) y:(y) speed: (speed)
repeat until <<(round (x position)) = (round (x))> and <(round (y position)) = (round (y))>>
set size to (300) %
change x by (((x) - (round (x position))) / (speed))
change y by (((y) - (round (y position))) / (speed))
set size to (100) %
end
go to x: (x) y: (y)
A scratcher that only makes games
See my best projects
Sword wars Multiplayer ⚔️ | Agario |Cloud Bullet Tutorial | cloud multiplayer engine
- Infinity-Studios5674
- Scratcher
100+ posts
Smooth glide off screen
The go to block is the problem:
set size to (300) %
go to x: (x:: custom) y: (y::custom)
set size to (100) %
..╭━━━━━━╮
╭┃ ╭━━━━╮
┃┃ ╰━━━━╯
┃┃
amongus
- BestTrainerMon_Intro
- Scratcher
5 posts
Smooth glide off screen
Now it works. Thank you The go to block is the problem:set size to (300) %
go to x: (x:: custom) y: (y::custom)
set size to (100) %
Last edited by BestTrainerMon_Intro (Aug. 1, 2021 15:00:06)
- Discussion Forums
- » Help with Scripts
- » Smooth glide off screen