Discuss Scratch
- fireincarnate
-
100+ posts
{} or {} hat block
Do you ever want to do something that can be triggered by two hat blocks, but you have to duplicate the entire script? This will fix that.

{hat block 1 :: events hat} or {hat block 2 :: events hat} :: extension hatThis triggers a script that is reached by two things happening (not at once, one or the other). for example,
{when green flag clicked :: events hat} or {when [space v] key pressed :: events hat} :: extension hat
do something :: operators

- mlcreater
-
1000+ posts
{} or {} hat block
You can already make something that happens with multiple hats without a giant duplicate script.

when green flag clickedThis adds a small number of blocks, but you don't have to copy the entire original script.
script::custom
when [space v] key pressed
script::custom
define script
do something::control

Last edited by mlcreater (May 28, 2020 13:50:58)
- fireincarnate
-
100+ posts
{} or {} hat block
I still like having the minimum amount of scripts in my sprites, even if it means having a giant script.
- mlcreater
-
1000+ posts
{} or {} hat block
Then I think something with the function of {}or{}::hat makes sense.
- HighFlyer222
-
100+ posts
{} or {} hat block
No support. This would confuse most of new Scratchers, and in my opinion, block inputs (the one you suggested, putting a block inside another block) don't fit well with Scratch. Also there must also be something like this i this gets implemented: (I think)
(hat 1::events hat) and (hat 2::events hat)::extension hat
- Zelfen
-
1000+ posts
{} or {} hat block
support, there is a workaround, but this shortens the code and cleans it up a bit
scratch could make a tutorial around the block No support. This would confuse most of new Scratchers, and in my opinion, block inputs (the one you suggested, putting a block inside another block) don't fit well with Scratch. Also there must also be something like this i this gets implemented: (I think)(hat 1::events hat) and (hat 2::events hat)::extension hat
- DarthVader4Life
-
1000+ posts
{} or {} hat block
{hat block 1 :: events hat} [or v] {hat block 2 :: events hat} :: extension hatI personally think that there should be a dropdown containing or, and, and not. (Maybe not not, though.)
Last edited by DarthVader4Life (July 14, 2021 17:35:45)
- Zelfen
-
1000+ posts
{} or {} hat block
fixed(hat 1 :: hat :: events) [or v] (hat 2 :: hat :: events) :: hat :: extensionsI personally think that there should be a dropdown containing or, and, and not. (Maybe not not, though.)
also, thats a good idea, +1
wait ninja'd, it was fixed as i posted this
Last edited by Zelfen (July 14, 2021 17:37:00)
- mbrick2
-
1000+ posts
{} or {} hat block
Here is a Workaround which is quite simple and clean
Just change the and to your conditions but remember that clicked is
The issue(s) with this are
when green flag clicked
forever
if <<> or <>> then
...
end
end
Just change the and to your conditions but remember that clicked is
<<mouse down?> and <touching [ v] ?>>
The issue(s) with this are
- When gf clicked does not have an option
- If the gf has not been clicked yet it does not work where as the hat blocks work whether gf clicked or not
- Tunde123
-
1000+ posts
{} or {} hat block
I honestly like this workaround more.
Also:when green flag clicked
script::custom
when [space v] key pressed
script::custom
define script
do something::control
While true, they might use the block anyways because they would want to find out about what it does. They could even use it in their projects. This would confuse most of new Scratchers
- -sil
-
50 posts
{} or {} hat block
Here's my mockup:
Basically the same thing but less confusing than the hat blocks in hat blocks idea. You could even possibly drag a hat block on one of the inputs and it sets it to the hat block!
If it was like this, I support.
[when green flag clicked v] or [when space key pressed v]::hat events
Basically the same thing but less confusing than the hat blocks in hat blocks idea. You could even possibly drag a hat block on one of the inputs and it sets it to the hat block!
If it was like this, I support.
- soarroying
-
500+ posts
{} or {} hat block
Same, but this suggestion has a legit workaround I still like having the minimum amount of scripts in my sprites, even if it means having a giant script.
when green flag clicked
whatever you want here :: custom
when [space v] key pressed
whatever you want here :: custom
define whatever you want here
A script :: #284
- Kiska-7275
-
1000+ posts
{} or {} hat block
Here is a Workaround which is quite simple and cleanThe sprite clicked is not same aswhen green flag clicked
forever
if <<> or <>> then
...
end
end
Just change the and to your conditions but remember that clicked is<<mouse down?> and <touching [ v] ?>>
The issue(s) with this are
- When gf clicked does not have an option
- If the gf has not been clicked yet it does not work where as the hat blocks work whether gf clicked or not
<<mouse down?> and <touching [mouse-pointer v] ?>>
- oooot5rises_again
-
48 posts
{} or {} hat block
I support it because it makes coding object shows ezier Do you ever want to do something that can be triggered by two hat blocks, but you have to duplicate the entire script? This will fix that.{hat block 1 :: events hat} or {hat block 2 :: events hat} :: extension hatThis triggers a script that is reached by two things happening (not at once, one or the other). for example,{when green flag clicked :: events hat} or {when [space v] key pressed :: events hat} :: extension hat
do something :: operators
- RED-001
-
500+ posts
{} or {} hat block
No support, this is just confusing and would serve no purpose.
Last edited by RED-001 (April 24, 2022 02:12:33)
- historical_supa
-
1000+ posts
{} or {} hat block
It would make hat blocks easier to use. No support, this is just confusing and would serve no purpose.
- thugatwoary
-
100+ posts
{} or {} hat block
The {} or {} block itself should be less confusing for new users - most blocks explain what they do in the words they have on them.
do this (when green flag clicked :: hat) or (when [space v] key pressed :: hat) :: events hatThe above script would be better, as it explains what the block does more clearly and also has a category, meaning it would be less confusing for someone new to Scratch.
- GabrielBoms
-
100+ posts
{} or {} hat block
(#14)coolSame, but this suggestion has a legit workaround I still like having the minimum amount of scripts in my sprites, even if it means having a giant script.when green flag clicked
whatever you want here :: custom
when [space v] key pressed
whatever you want here :: custom
define whatever you want here
A script :: #284