Welcome to our exciting lesson on Sound Effects! In this lesson, we will learn how to add sound effects to a baseball game in Scratch. We'll add sounds for when the ball hits the bat and when the crowd cheers. Are you ready to make your game more lively and fun? Let's get started!
Create a new Scratch project and delete the cat sprite.
Go to the Scratch website using the link below and click on the 'Create' link in the blue bar at the top.
By default, each new project starts with the cat sprite already added. To delete the cat click on the x in the blue circle beside the cat in the sprite list.
Ass the Baseball 2 backdrop from the backdrop library.
To add a backdrop from the backdrop library follow these steps:
You can use search box or the filter links (Fantasy, Music, Sports etc) to locate your backdrop.
Add the Batter sprite from the sprite library and then add the following code to make her swing bat when you press the space bar.
when green flag clicked
go to x (169) y (37) // position her on the right hand side
switch costume to [batter-a v] // start with this costume
when [space v] key pressed
switch costume to [batter-b v]
wait (.1) seconds
switch costume to [batter-c v]
wait (.1) seconds
switch costume to [batter-d v]
wait (.1) seconds
Since your tablet or iPad doesn’t have a physical keyboard, you’ll use on-screen buttons to complete this task. Wherever the instructions in this lesson mention pressing a key, you’ll need to tap a button on the screen instead. So, while your steps are a little different, you’ll still be able to make everything happen in your project.
So for example, instead of doing either of these:
when [left arrow v] key pressed
move (10) steps
if < key [left arrow v] pressed? > then
move (10) steps
end
You need to add an on-screen button (like an arrow sprite) and use this code:
when this sprite clicked
move (10) steps
Now, just tap the button on the screen to perform the same action!
Add the Baseball sprite from the sprite library and give it the following code to set it up for the start and make it move towards the batter.
when green flag clicked
show
set size to (25) %
go to x (-210) y (45) // the middle of the left hand side
forever
change x by (10) // make it move to the right
end
To add a sprite from the sprite library follow these steps:
You can use search box or the filter links (Animals, People, Fantasy etc) to locate your sprite.