Discuss Scratch
- Discussion Forums
- » Suggestions
- » Scratch Workaround Guide VII
- Davido2210
-
27 posts
Scratch Workaround Guide VII
Why are there no “Sound” workarounds? (Although I could have sworn there was a pause sound thing or something)
- _nix
-
1000+ posts
Scratch Workaround Guide VII
mrrrr, we haven't written them into the guide yet, is all ^^ Why are there no “Sound” workarounds? (Although I could have sworn there was a pause sound thing or something)
we are only aware of two sound workarounds shared on this forum thread - “pause/resume all sounds” and “stop sound” as shared by @jmdtzi_0-0 in this post - so if you are aware of any others (or you'd like to share alternate workarounds), you are much encouraged to. else, yes, it's just we are only aware of these two and have not brought them into the main guide yet.
- WsDanzel
-
47 posts
Scratch Workaround Guide VII
I've found no workarounds and I've decided to make my own
:
estimate (70) moves :: motion
:
forever
move (1) steps
turn cw (1) degrees
end
- secretuch
-
100+ posts
Scratch Workaround Guide VII
WHAT THE, LIMITLESS POSITION WONT WORK 3D Go To (will likely be used for complex things like 3D but the code itself is not complex)define Go to (X) (Y) (Z) in 3D with focal length (focal length)
go to x: ((X) * ((focal length) / (Z))) y: ((Y) * ((focal length) / (Z)))
Or if you don't like that, how about this:
Make sprites bigger than the camera (note: you need an empty costume for this, and the limit is 27000)define set limitless size to (limitlessSize)You can use this block for my next one: Limitless Moving:
switch costume to [empty sprite v]
set size to (limitlessSize) %
switch costume to [your sprite v]define set limitless position to (X) (Y)
set [sizeVar v] to (size)
set limitless size to (27000) :: custom
go to x: (X) y: (Y)
set limitless size to (sizeVar) :: custom

- TheCreatorOfUnTV
-
1000+ posts
Scratch Workaround Guide VII
It actually does work due to how Scratch handles fencing. -snip-
- breakfast_for_dinner
-
1000+ posts
Scratch Workaround Guide VII
(#325)you should try stuff out before saying it doesn't work
WHAT THE, LIMITLESS POSITION WONT WORK
- WsDanzel
-
47 posts
Scratch Workaround Guide VII
Creating BIG Projection by variable value
The workaround is about 40% or 60% hard, firstly you must put out this code:define set vars to (var value)
set [var1 v] to [var value]
set [var2 v] to [var value]
-Secondly, connect this code:set [bbvar v] to [var value]
set [xxvar v] to [var value]
Done! if you don't like the variable names, you can change them
Before using the code, you must have a “my block” named “set vars to (var value)”
And you may have to have to put your “my block” in the code box
- secretuch
-
100+ posts
Scratch Workaround Guide VII
I did not say snipIt actually does work due to how Scratch handles fencing. -snip-
- PaperMarioFan2022
-
1000+ posts
Scratch Workaround Guide VII
Keep the discussion on topic, please. This is about workarounds, not snipping posts.I did not say snipIt actually does work due to how Scratch handles fencing. -snip-
Last edited by PaperMarioFan2022 (Aug. 30, 2024 13:42:50)
- TheCreatorOfUnTV
-
1000+ posts
Scratch Workaround Guide VII
comment [] :: greycan be recreated with
define // (comment)
- secretuch
-
100+ posts
Scratch Workaround Guide VII
How does is workcomment [] :: greycan be recreated withdefine // (comment)
- A-MARIO-PLAYER
-
1000+ posts
Scratch Workaround Guide VII
it does nothing How does is work
its meant to explain some complicated code
- _nix
-
1000+ posts
Scratch Workaround Guide VII
Yaknow what, I like it LOL. Thanks! I added it to the Miscellaneous section. Lemme know if you (@TheCreatorOfUnTV) want credits for suggesting it - I didn't include credits coz it's, you know, it literally doesn't have any code blocks and it's a pretty common technique, but I'm still thankful for you suggesting it.it does nothingHow does is workcomment [] :: greycan be recreated withdefine // (comment)
its meant to explain some complicated code
I also added buttons to scroll right up to the table of contents, at the top of each post. And I made it so all the links actually SCROLL you there, instead of just reloading the whole darn page LOL. Should make the guide a bit nicer to navigate!
- TheCreatorOfUnTV
-
1000+ posts
Scratch Workaround Guide VII
I don't need credit, but it would be nice.Yaknow what, I like it LOL. Thanks! I added it to the Miscellaneous section. Lemme know if you (@TheCreatorOfUnTV) want credits for suggesting it - I didn't include credits coz it's, you know, it literally doesn't have any code blocks and it's a pretty common technique, but I'm still thankful for you suggesting it.it does nothingHow does is workcomment [] :: greycan be recreated withdefine // (comment)
its meant to explain some complicated code
I also added buttons to scroll right up to the table of contents, at the top of each post. And I made it so all the links actually SCROLL you there, instead of just reloading the whole darn page LOL. Should make the guide a bit nicer to navigate!
- _nix
-
1000+ posts
Scratch Workaround Guide VII
Sure thing, I just updated the entry. Thanks again for the suggestion!Miscellaneous section. Lemme know if you (@TheCreatorOfUnTV) want credits for suggesting it - I didn't include credits coz it's, you know, it literally doesn't have any code blocks and it's a pretty common technique, but I'm still thankful for you suggesting it.I don't need credit, but it would be nice. (snip) I added it to the
- rubber-duck-lord
-
26 posts
Scratch Workaround Guide VII
what about this workaround for "glide to (x) (y) at speed (speed):
I think this is the most popular workaround?
define glide to (x), (y) at speed (speed)
set [_vecx v] to ((x) - (x position))
set [_vecy v] to ((y) - (y position))
set [_vecmag v] to ([sqrt v] of (((_vecx) * (_vecx)) + ((_vecy) * (_vecy))))
set [_vecx v] to ((_vecx) / (_vecmag))
set [_vecy v] to ((_vecy) / (_vecmag))
set [_fixedspeed v] to ((speed) / (30))
repeat ([floor v] of ((_vecmag) / (_fixedspeed)))
change x by ((_vecx) * (_fixedspeed))
change y by ((_vecy) * (_fixedspeed))
end
go to x: (x) y: (y)
I think this is the most popular workaround?
- 8to16
-
1000+ posts
Scratch Workaround Guide VII
May I suggest adding the
when (::obsolete) clicked :: events hatworkaround?
when gf clicked
forever
set [timer v] to (timer)
end
when [timer v] > (timer::variables)
...
Last edited by 8to16 (Sept. 30, 2024 11:23:37)
- _nix
-
1000+ posts
Scratch Workaround Guide VII
Well, I was going to add something really similar to this, and I wrote up the description, which you can read below if you want to… what about this workaround for "glide to (x) (y) at speed (speed):
(snip)
I think this is the most popular workaround?
This method is a lot older and works in earlier versions of Scratch, which didn't have “glide to x: y:”. Instead, we'll use “repeat” and “go to x: y:” to make the same movement ourselves.
The rest of the workaround is similar—we still need to know the distance—but this time, because “repeat” runs at 30 frames per second (when it contains a motion block), we need to do our math in terms of frames instead of seconds.
First we calculate the number of steps we're going to take. Because this might not be a whole number—and it's impossible to repeat 57.321 times!—we round it to the nearest whole number.
Then we calculate the size of each step. We need to know how far the sprite will move, horizontally and vertically, each step. We just divide the distances by the total number of steps. For example, a sprite gliding from (0, 0) to (80, 60) over 20 steps will travel a total distance of 80 steps horizontally, and 60 steps vertically. So each frame it travels 80 / 20 = 4 steps horizontally, and 60 / 20 = 3 steps vertically.define glide: (speed) steps per sec to x: (x) y: (y)
get distance to x: (x) y: (y) :: custom // Or use the variable blocks in Method 1
set [glide total steps v] to (round ((30) * ((distance to position) / (speed)))
set [glide step x v] to (((x) - (x position)) / (glide total steps))
set [glide step y v] to (((y) - (y position)) / (glide total steps))
repeat (glide total steps)
go to x: ((x position) + (glide step x)) y: ((y position) + (glide step y))
end
But then I realized of course old versions of Scratch have “glide: secs to: x: y:”, so this implementation is just way more complicated than it ever needs to be…

We did add different workarounds for “glide: steps per sec to x: y:” and “glide: steps per sec to sprite:” though! Check them out! Or spoiler alert, they're just this:
define glide (speed) steps per sec to x: (x) y: (y)
get distance to x: (x) y: (y) :: custom
glide ((distance to position) / (speed)) secs to x: (x) y: (y)
define glide (speed) steps per sec to sprite: (sprite)
glide ((distance to (sprite)) / (speed)) secs to (sprite) :: motion
Thank you for the suggestion. Hopefully it's not too much of a bother that we used a different approach than that code (which I totally admit might be a really popular workaround). We try to make the workarounds in this guide use Scratch's existing blocks to their fullest potential (as best as we can lol), so if we know of a simpler approach with the same results, that's the one we generally take.
- Discussion Forums
- » Suggestions
-
» Scratch Workaround Guide VII