Discuss Scratch

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

{} or {} hat block

You can already make something that happens with multiple hats without a giant duplicate script.
when green flag clicked
script::custom
when [space v] key pressed
script::custom
define script
do something::control
This adds a small number of blocks, but you don't have to copy the entire original script.

Last edited by mlcreater (May 28, 2020 13:50:58)

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

{} or {} hat block

Then I think something with the function of {}or{}::hat makes sense.
HighFlyer222
Scratcher
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
Scratcher
1000+ posts

{} or {} hat block

support, there is a workaround, but this shortens the code and cleans it up a bit

HighFlyer222 wrote:

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
scratch could make a tutorial around the block
DarthVader4Life
Scratcher
1000+ posts

{} or {} hat block

{hat block 1 :: events hat} [or v] {hat block 2 :: events hat} :: extension hat
I 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
Scratcher
1000+ posts

{} or {} hat block

DarthVader4Life wrote:

(hat 1 :: hat :: events) [or v] (hat 2 :: hat :: events) :: hat :: extensions
I personally think that there should be a dropdown containing or, and, and not. (Maybe not not, though.)
fixed

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)

VedanshS933
Scratcher
1000+ posts

{} or {} hat block

Bump
mbrick2
Scratcher
1000+ posts

{} or {} hat block

Here is a Workaround which is quite simple and clean

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

{} or {} hat block

I honestly like this workaround more.

mlcreater wrote:

when green flag clicked
script::custom
when [space v] key pressed
script::custom
define script
do something::control
Also:

HighFlyer222 wrote:

This would confuse most of new Scratchers
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.
Tunde123
Scratcher
1000+ posts

{} or {} hat block

5th page bump.
-sil
Scratcher
50 posts

{} or {} hat block

Here's my mockup:

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

{} or {} hat block

fireincarnate wrote:

I still like having the minimum amount of scripts in my sprites, even if it means having a giant script.
Same, but this suggestion has a legit workaround
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
Scratcher
1000+ posts

{} or {} hat block

mbrick2 wrote:

Here is a Workaround which is quite simple and clean

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
The sprite clicked is not same as
<<mouse down?> and <touching [mouse-pointer v] ?>>
oooot5rises_again
Scratcher
48 posts

{} or {} hat block

fireincarnate wrote:

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 hat
This 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
I support it because it makes coding object shows ezier
RED-001
Scratcher
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
Scratcher
1000+ posts

{} or {} hat block

RED-001 wrote:

No support, this is just confusing and would serve no purpose.
It would make hat blocks easier to use.
thugatwoary
Scratcher
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 hat
The 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
Scratcher
100+ posts

{} or {} hat block

soarroying wrote:

(#14)

fireincarnate wrote:

I still like having the minimum amount of scripts in my sprites, even if it means having a giant script.
Same, but this suggestion has a legit workaround
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
cool

Powered by DjangoBB