arrow_back Out of this Ballpark
In this add-on, you will program the crowd to cheer if the batter hits the ball.
Scratch has two sound blocks: “play sound” and “play sound until done.”
When Scratch runs a “play sound until done” block, it plays the sound to the end before running the next block below it. When Scratch runs a “play sound” block, it starts playing the sound, then immediately runs the next blocks. It will stop playing the sound when it runs into a “play sound” block again.
To put your sound into a loop, use the “play sound until done” block. Whichever block you use, click the dropdown, and choose “cheer.” Consider where to place the “play sound” block to make the cheer happen when the batter hits the ball. Should it be inside the repeat loop or before or after it? Should it be inside the “if touching color red” block or before or after it? Keep tinkering and trying different things until you have something you like.
Computer scientists like you don’t always get things exactly right the first time. They use courage and persistence to keep trying and learning from their mistakes.
If you need help, ask a neighbor. If you still need help, ask a Host or Guru.
Here's the game plan: Use a “play sound” or “play sound until done” block to make the crowd cheer when the ball is hit.