(Redirected from Control Block)
- "Yellow Blocks" redirects here. For the light yellow blocks, see Events Blocks.
Control is one of the ten categories of Scratch blocks. They are color-coded amber, and are used to control scripts under certain conditions.
In Scratch 1.4 and earlier, this category also included the blocks that are now Events Blocks.
There are currently 11 Control blocks: 1 Hat block, 5 C blocks, 3 Stack blocks and 2 Cap blocks.
Blocks
Note: | Click on a block to learn more about it. |
Scratch 3.0 has one Control Hat block:
Scratch 3.0 has the following 3 Control Stack blocks:
Scratch 3.0 has the following 5 Control C blocks:
Scratch 3.0 has the following 2 Control Cap blocks:
However, the stop [ v]
block can become a stack block if the "other scripts in sprite" option is chosen.
Obsolete Blocks
This article or section documents something not included in the current version of Scratch (3.0). It is only useful from a historical perspective. |
forever if <> { }:: control cap
Prior to Scratch 2.0, there was a "Forever If ()" block, which would continuously check its boolean condition, and only run code in the block if the condition was true. It was removed for being overly confusing,[1] and can be replaced with a workaround:
forever if <> then end end
Two additional blocks were also available in Scratch 2.0, being the Stop Script and Stop All blocks. These two blocks were merged with the new Stop () block in Scratch 3.0.
Suggestions
Scratchers have suggested a Control block that repeats the blocks for a set amount of time:[2]
repeat for () seconds { } :: control loop
A workaround for this is possible:
reset timer repeat until <() < (timer)>
See Also
References
- ↑ Paddle2See. (19/4/2020). "It was removed because many beginning Scratchers found it overly confusing" post:4034761
- ↑ topic:20841