Discuss Scratch

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:

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

Infinity-Studios5674 wrote:

The go to block is the problem:

set size to (300) %
go to x: (x:: custom) y: (y::custom)
set size to (100) %
Now it works. Thank you

Last edited by BestTrainerMon_Intro (Aug. 1, 2021 15:00:06)

Powered by DjangoBB