Discuss Scratch

A-MARIO-PLAYER
Scratcher
1000+ posts

Run Green Flag block

Revival of this topic which was closed by the OP. I am recreating the topic and taking responsibility over the suggestion again, just as I did before my other Run Green Flag topic was merged with the closed topic I linked.

This is inspired by Scratch 0.x (because the green flag didn't exist, and you had two wave blocks instead) and a Scratch mod related to a species of flightless birds.

click @greenFlag :: control

This block basically emulates clicking the green flag. E.g.

when [space v] key pressed
click @greenFlag :: control

when green flag clicked
turn cw (22.5) degrees

It could be used for restarting if the player makes a mistake.

Other versions:
click @greenFlag :: sensing // Sensing category

click @greenFlag :: control cap // Cap

run @greenFlag :: control // Alternative name

Mockups in 3.0, made here by han614698: Note this still uses the color from Events


In my original topic about this (which was merged with the one that got closed,) the block used to be in Events. However, the stop all block is in Control, and the run green flag block in the penguin version of Scratch is also in Control, so it makes more sense to have this block in control.

Last edited by A-MARIO-PLAYER (Sept. 10, 2024 22:54:37)

TheEpikGamer211
Scratcher
1000+ posts

Run Green Flag block

when green flag clicked
run @greenFlag :: events
sgary
A-MARIO-PLAYER
Scratcher
1000+ posts

Run Green Flag block

TheEpikGamer211 wrote:

when green flag clicked
run @greenFlag :: events
sgary
can you explain please?
TheEpikGamer211
Scratcher
1000+ posts

Run Green Flag block

A-MARIO-PLAYER wrote:

can you explain please?
I thinke that would crash scartch

Last edited by TheEpikGamer211 (Sept. 10, 2024 17:42:13)

A-MARIO-PLAYER
Scratcher
1000+ posts

Run Green Flag block

TheEpikGamer211 wrote:

I thinke that would crash scartch
it wouldnt

if you run that script in the penguin version of scratch, it just acts like putting a forever block with nothing inside under a when gf clicked block.

tldr:
when gf clicked
run @greenFlag :: control
=
when gf clicked
forever

Last edited by A-MARIO-PLAYER (Sept. 10, 2024 17:45:00)

banana439monkey
Scratcher
1000+ posts

Run Green Flag block

why can't you use broadcasts

Banana
DangerPuppy10
Scratcher
1000+ posts

Run Green Flag block

What would happen if somebody did this?

when green flag clicked
forever
click @greenFlag ::control
end
-Rodri
Scratcher
1000+ posts

Run Green Flag block

for your example couldnt you just do:

when [space v] key pressed
turn ccw (22.5) degrees

when green flag clicked
turn ccw (22.5) degrees

(maybe this isnt a good solution in all cases, but I'm no coding pro lol :p)

Last edited by -Rodri (Sept. 10, 2024 21:40:36)

A-MARIO-PLAYER
Scratcher
1000+ posts

Run Green Flag block

-Rodri wrote:

for your example couldnt you just do:

when [space v] key pressed
turn ccw (22.5) degrees

when green flag clicked
turn ccw (22.5) degrees
What if you had much more scripts there? Waste of valuable project.json storage.

Edit spy

Last edited by A-MARIO-PLAYER (Sept. 10, 2024 21:41:15)

MagicCoder330
Scratcher
1000+ posts

Run Green Flag block

maybe make it so int only works every 10 seconds? that would fix some problems I thought it might have.
TheCreatorOfUnTV
Scratcher
1000+ posts

Run Green Flag block

So, like this?
broadcast [Scratch-StartClicked v] and wait // This would restart the project from the green flag in Scratch 1.4.
A-MARIO-PLAYER
Scratcher
1000+ posts

Run Green Flag block

TheCreatorOfUnTV wrote:

So, like this?
broadcast [Scratch-StartClicked v] and wait // This would restart the project from the green flag in Scratch 1.4.
yeah
but you can't do that in scratch 3.0 anymore bruh
TheCreatorOfUnTV
Scratcher
1000+ posts

Run Green Flag block

A-MARIO-PLAYER wrote:

TheCreatorOfUnTV wrote:

So, like this?
broadcast [Scratch-StartClicked v] and wait // This would restart the project from the green flag in Scratch 1.4.
yeah
but you can't do that in scratch 3.0 anymore
I know - I never suggested it as a workaround.

Last edited by TheCreatorOfUnTV (Sept. 10, 2024 22:20:33)

Za-Chary
Scratcher
1000+ posts

Run Green Flag block

banana439monkey wrote:

why can't you use broadcasts

Banana
Expanding on this: when you code a project and you use the “when green flag clicked” block, replace it with this block:

when I receive [green flag v]

Then, never use the “when green flag clicked” block, except for one single time where you include this script somewhere:

when green flag clicked
broadcast [green flag v]

Now, whenever you want to use your proposed block, just use "broadcast [green flag v]" instead. This workaround is pretty useful and easy to make.
A-MARIO-PLAYER
Scratcher
1000+ posts

Run Green Flag block

bump
(i swear i need to create a cubeupload account and make myself a personal bump image)
yadayadayadagoodbye
Scratcher
1000+ posts

Run Green Flag block

DangerPuppy10 wrote:

What would happen if somebody did this?

when green flag clicked
forever
click @greenFlag ::control
end
That would effectively be the same as

when green flag clicked
click @greenFlag ::control

because when the green flag is clicked, any previous running code is stopped

Powered by DjangoBB