Discuss Scratch

Davido2210
Scratcher
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
Scratcher
1000+ posts

Scratch Workaround Guide VII

Davido2210 wrote:

Why are there no “Sound” workarounds? (Although I could have sworn there was a pause sound thing or something)
mrrrr, we haven't written them into the guide yet, is all ^^

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.
abubriski
Scratcher
500+ posts

Scratch Workaround Guide VII

Davido2210 wrote:

Why are there no “Sound” workarounds? (Although I could have sworn there was a pause sound thing or something)
I found a sound-related trick >>here<<. (please tell me if I'm not supposed to say it here)
WsDanzel
Scratcher
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
Scratcher
100+ posts

Scratch Workaround Guide VII

TheCreatorOfUnTV wrote:

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)
switch costume to [empty sprite v]
set size to (limitlessSize) %
switch costume to [your sprite v]
You can use this block for my next one: Limitless Moving:
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
WHAT THE, LIMITLESS POSITION WONT WORK
TheCreatorOfUnTV
Scratcher
1000+ posts

Scratch Workaround Guide VII

secretuch wrote:

-snip-
It actually does work due to how Scratch handles fencing.
breakfast_for_dinner
Scratcher
1000+ posts

Scratch Workaround Guide VII

secretuch wrote:

(#325)
WHAT THE, LIMITLESS POSITION WONT WORK
you should try stuff out before saying it doesn't work
WsDanzel
Scratcher
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
Scratcher
100+ posts

Scratch Workaround Guide VII

TheCreatorOfUnTV wrote:

secretuch wrote:

-snip-
It actually does work due to how Scratch handles fencing.
I did not say snip
PaperMarioFan2022
Scratcher
1000+ posts

Scratch Workaround Guide VII

secretuch wrote:

TheCreatorOfUnTV wrote:

secretuch wrote:

-snip-
It actually does work due to how Scratch handles fencing.
I did not say snip
Keep the discussion on topic, please. This is about workarounds, not snipping posts.

Last edited by PaperMarioFan2022 (Aug. 30, 2024 13:42:50)

TheCreatorOfUnTV
Scratcher
1000+ posts

Scratch Workaround Guide VII

comment [] :: grey
can be recreated with
define // (comment)
secretuch
Scratcher
100+ posts

Scratch Workaround Guide VII

TheCreatorOfUnTV wrote:

comment [] :: grey
can be recreated with
define // (comment)
How does is work

A-MARIO-PLAYER
Scratcher
1000+ posts

Scratch Workaround Guide VII

secretuch wrote:

How does is work
it does nothing
its meant to explain some complicated code
_nix
Scratcher
1000+ posts

Scratch Workaround Guide VII

A-MARIO-PLAYER wrote:

secretuch wrote:

TheCreatorOfUnTV wrote:

comment [] :: grey
can be recreated with
define // (comment)
How does is work
it does nothing
its meant to explain some complicated code
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.

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
Scratcher
1000+ posts

Scratch Workaround Guide VII

_nix wrote:

A-MARIO-PLAYER wrote:

secretuch wrote:

TheCreatorOfUnTV wrote:

comment [] :: grey
can be recreated with
define // (comment)
How does is work
it does nothing
its meant to explain some complicated code
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.

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!
I don't need credit, but it would be nice.
_nix
Scratcher
1000+ posts

Scratch Workaround Guide VII

TheCreatorOfUnTV wrote:

_nix wrote:

(snip) 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.
I don't need credit, but it would be nice.
Sure thing, I just updated the entry. Thanks again for the suggestion!
rubber-duck-lord
Scratcher
26 posts

Scratch Workaround Guide VII

what about this workaround for "glide to (x) (y) at speed (speed):

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?

1080GBA
Scratcher
500+ posts

Scratch Workaround Guide VII

TheCreatorOfUnTV wrote:

(#331)
comment [] :: grey
can be recreated with
define // (comment)
define comment ()

comment []::custom
8to16
Scratcher
1000+ posts

Scratch Workaround Guide VII

May I suggest adding the
when (::obsolete) clicked :: events hat
workaround?

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
Scratcher
1000+ posts

Scratch Workaround Guide VII

rubber-duck-lord wrote:

what about this workaround for "glide to (x) (y) at speed (speed):
(snip)
I think this is the most popular workaround?
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…

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.

Powered by DjangoBB