Control blocks are essential for managing scripts in Scratch. Let’s explore these blocks with Arun and Raj.
Arun: Raj, today we’ll learn about Control blocks in Scratch.
Raj: Great, let’s start!
Arun: The [when I start as a clone] block is a Hat block triggered whenever a clone is created.
Raj: Got it! What’s next?
Arun: There are three Stack blocks. [wait (1) seconds] pauses the script for a set time.
Raj: So, it waits before running the next command.
Arun: Exactly! Next, [wait until <condition>] pauses the script until the condition is true.
Raj: And this runs only when the condition is met.
Arun: Correct! [create clone of [myself v]] creates a specified clone.
Raj: Cool, it duplicates the sprite!
Arun: Now, let’s talk about the five C blocks. [repeat (10)] loops a specified number of times.
Raj: Repeats the commands inside it, right?
Arun: Yes. The [forever] loop runs indefinitely until stopped.
Raj: Useful for continuous actions.
Arun: [if <condition>] checks a condition, running the blocks inside if true.
Raj: Executes only when the condition is met.
Arun: [if <condition> then] [else] checks a condition, running one set of blocks if true, and
another if false.
Raj: Runs different scripts based on the condition.
Arun: Finally, [repeat until <condition>] loops until the condition is true.
Raj: Keeps looping until the condition is met.
Arun: Now, the two Cap blocks. [stop [all v]] stops scripts as chosen in the drop-down menu.
Raj: So, it can stop everything or specific scripts.
Arun: Exactly. The [delete this clone] block deletes a clone.
Raj: Removes the duplicate sprite.
Arun: Perfect! Now you know all about Control blocks. Next time, we’ll explore more about loops and conditions.
Raj: Thanks, Arun! This is really helpful.