Please update your browser
Your browser version is not supported by this site. CS First may not work properly.
In this add on,
you'll program a reaction from when your friend
gets the answer wrong.
First program the reaction.
You might want the reaction to include sound.
To add a sound to your project,
click on the sounds tab
and the choose sound from library button.
Select one you like,
Scratch offers two sound blocks, both in the sound menu.
The play sound block starts to play the sound
then immediately runs the next block.
The sound will stop either when it's done playing
or when another sound block tries to play.
The play sound until done block
pauses the rest of the code until a sound finishes playing.
Different blocks are useful for different situations.
You might also switch the backdrop to one
that says you lose.
To do this, create a new backdrop.
To create a new backdrop click on the stage
in the Sprites menu.
Click on backdrops,
then choose paint new backdrop.
Tinker with the tools available in Scratch.
This example uses the paint bucket
to build the entire stage with one color.
Then use the text tool,
you can also paint with the paintbrush,
or draw lines, circles, and rectangles.
Name the backdrop you created, losing backdrop.
From the looks menu,
find the switch backdrop to block.
This block allows Sprites to change the backdrop.
Place a switch backdrop to block in the else section
of the if else block.
That way it will run when your friend gets the answer wrong.
Click the flag and choose a truth to test your code.
If your losing condition includes a backdrop change,
you'll notice the backdrop doesn't return to the original.
To reset to the original backdrop,
place a switch backdrop to block at the top of your code.
From the dropdown,
select the original backdrop.
You can skip this step if you're also doing
the title screen add on.
Now it's your turn.
Program a losing condition.
You can add sound using the play sound
or play sound until done blocks.
You can add a new backdrop.
Or you can use your creativity to program
a fun losing condition for your friend.
Place the losing condition in the else section
of the if else block.