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 Bruitages d'accident

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!

Choisir une extension
Modifie ton circuit
Ajoute un bouton qui change l'arrière-plan circuit.
Changement de costume
Change l'apparence des coureurs lorsqu'une touche est appuyée.
Appuie sur le champignon (Part 1 of 2)
Change la façon dont les coureurs se déplacent, puis fais-les ralentir sur l'herbe.
Appuie sur le champignon (Part 2 of 2)
Change la façon dont les coureurs se déplacent, puis fais-les ralentir sur l'herbe.
Bruitages d'accident
Joue un bruitage d'accident chaque fois que les coureurs se percutent.
Supporters
Programme un lutin pour qu'il effectue un compte à rebours pour le départ de la course et qu'il encourage les coureurs.
Trace de couleur
Ajoute un effet de trace de couleur aux coureurs.
arrow_backward Retour
Suivant arrow_forward
Instructions
  1. Choisis une extension, et clique sur le bouton "Regarder" pour découvrir comment la créer.
  2. Quand tu as fini, reviens à l'écran des extensions et essaies-en une autre !