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 Acclamations

Transcript

In this add-on, you will create a sprite that says random phrases to cheer on the racer.

To start, add a new sprite using the “Choose sprite from library” button. Select any sprite you want to be the cheerleader. This example uses Dan.

Now, create a list of phrases for the sprite to say. To do this, open the “data” menu and click “make a list.” Name the list something descriptive, like “Happy Cheers.”

Click “ok.”

After creating the list, two items appeared: a bunch of blocks and a grey box with the list name on the stage. To add a phrase to the list, click the “plus” sign in the grey box, and start typing. Add at least 4 phrases to the list.

Next, make the sprite say a random phrase from this list. Open the “looks” menu, and add a “say for 2 seconds” block. Then, open the “data” menu, and add an “item of” block to the “say” block. Open the dropdown menu, and select “random.” The block now reads “say item random of Happy Cheers for 2 seconds.”

Click on the block and watch what happens. Great! The sprite says a random phrase from the list every time the block is clicked. Next, make the sprite say phrases at random times. To do this, put a “forever” loop around the “say” block, and add a “wait” block. Insert a “pick random” block from the “operators” menu inside the “wait” block, and set the wait time to whatever you want. This example will wait a random time between 2 and 5 seconds. Then, add a “when flag clicked” block to the top of the “forever” loop.

Test out your code by clicking the flag. Great! The cheerleading sprite says phrases at random times! However, the list and the sprite are in the way of the game. To hide the list from view, open the “data” menu and uncheck the box next to the list name.

Hide the cheerleading sprite when it’s not saying anything by adding a “show” block before the “say” block and a “hide” block after the “say” block. Move the sprite to where you want it to appear.

Now test out your game. Nice! It works! Here’s the gameplan: Add a sprite to be the cheerleader. Create a list of phrases for the sprite to say. Make the sprite say random phrases at random times using a “say for 2 seconds” block, an “item of” block, a “when flag clicked” block, a “forever” block, a “wait” block, and a “pick random” block.

Hide the list and the sprite from view so they don’t cover up the game.

Choisir une extension
Écran de démarrage
Ajoute un écran de démarrage avec des instructions pour ton jeu.
Enregistrer le score
Comptabilise la durée pendant laquelle un coureur reste en vie et affiche le score.
Acclamations
Crée un lutin qui acclame le coureur.
Tours extrêmes
Programme ton coureur pour qu'il fasse un gag amusant sur pression d'un bouton.
Bonus
Crée un bonus qui rétrécit le coureur.
Bruitage
Ajoute un son à jouer lorsque le coureur percute un obstacle.
arrow_backward Retour
Suivant arrow_forward
Instructions
  1. Choisis une extension, et clique sur "Regarder" pour découvrir comment personnaliser ton projet.
  2. Quand tu as fini, reviens à la page des extensions et essaies-en une autre !