Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more

arrow_back Crashing Sounds

Choose an Add-On
play_circle_filled
Change Up your Racetrack
Add a button that changes the racetrack backdrop.
arrow_forward
play_circle_filled
Costume Change
Change what the racers look like when a key is pressed.
arrow_forward
play_circle_filled
Step on the Gas (Part 1 of 2)
Change how fast the racers move, then make them slowdown on the grass.
arrow_forward
play_circle_filled
Step on the Gas (Part 2 of 2)
Change how fast the racers move, then make them slowdown on the grass.
arrow_forward
play_circle_filled
Crashing Sounds
Play a crashing sound each time the racers hit each other.
arrow_forward
play_circle_filled
Race Fans
Program a sprite to count down to the start of the race and cheer.
arrow_forward
play_circle_filled
Color Trail
Add a colorful trail effect to the racers.
arrow_forward
  • 1. Opening the Starter Project
  • 2. Move the Sprite
  • 3. Moving More Smoothly with "Repeat Until"
  • 4. Add-Ons
  • 5. Reflection
  • 6. Wrap-up: A Racing Game
  • 7. Wrap-up: Share Your Project
  • 8. Wrap-up: Show Your Project
arrow_backward Back Next arrow_forward
Transcript

In this add-on, I'll show you how to program your two sprites to play a crashing sound if they touch.

To code this, use an “if” block. When you’re done with this step, this “if” block will read, “if touching player 2, play a sound.”

To start, click on player 1. Then, click on events and select a "when green flag clicked” block to start. Next, go to control and select a “forever loop.’’ Inside of this "forever loop," I'll put an "if" statement, which is also found in control.

Now, program this to say: If touching player 2, play a sound.

Click on Sensing, and select a "touching" block and change the value to Player 2.

Now, you need a sound!

Click on the sounds tab, and select "choose sound from library."

This example uses “scream-male1,” but you can select whatever sound you want for your project.

you can select whichever sound you want for your project.

Click the “scripts” tab, select the sound menu, and choose “play sound scream-male 1 until done.” Then, place this block in your if statement.

Now, the code reads: “Once this program starts, if player 1 touches player 2, play the male-scream sound.” Let's try it!

(chuckles) Great! Now if the two players crash into each other, a cool scream sound plays. This is a fun add-on to try with someone else, so be sure to try your game with a neighbor!

Instructions
  1. Choose an Add-On, and click "watch" to learn how to build it.
  2. Once you finish one Add-On, try another one below the video!