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 Le soleil brille


In this add-on, you’ll program a second scene for your rainy day story. This will be a particularly challenging add-on because you will need to fix a lot of bugs to make this work! To start, give your second scene a backdrop by clicking “choose backdrop from library” and choosing a scene. This example will use something sunny, like water and rocks. Next, program the backdrop to change at the end of your first scene. In this example, the last thing that happens is this character saying “Me too.” Click looks, drag out a “change backdrop to” block, and place it at the end of your story. Click the dropdown menu, and select your second backdrop. Try it out!

Great! The backdrop changes, but as you might have guessed, changing the backdrop presents a lot of new problems, or bugs. If you take a look at this story, you’ll notice that: It’s still raining. The “earth” sprite is still showing.

The lightning code for the backdrop is still running.

The lightning switches between all three backdrops, not just the lightning and night sky.

Successful programmers and computer scientists solve these types of problems every day. They break down bugs into individual problems and solve them one at a time with creativity and persistence. Be sure to test your code every time you come up with a fix, to check that you solved the problem.

Next, hide the rain sprite when the backdrop changes. Click the rain sprite. Select the looks menu, and drag out a “show” and a “hide” block. The rain should show at the start of the program, so place the “show” block after the green flag. The sprite should hide when the backdrop changes, so click events, and drag out a “when backdrop changes to” block. Change the dropdown to match the name of your second backdrop.

Test this out. The rain should show at the beginning of the story, and hide when the backdrop changes. Great! Two problems solved.

You can use the same approach to hide the earth. Show the “earth” sprite at the start of the program, and hide the “earth” sprite when the backdrop changes. Try it out.

That’s three problems solved. Now, tackle the problems with the lightning.

Click the stage. The lightning is switching between all three backdrops because this code uses a “next backdrop” block. Replace the “next backdrop” block with a “change backdrop to” block, and change the name to “night sky.” Then, add another “change backdrop to” block, and change the name to “lightning.”

Try it out! Nice, the lightning only switches between the lightning and night sky. Four problems solved. You’re almost there! Finally, program the lightning code to stop running when the backdrop changes to your second scene.

Drag out a “when backdrop changes” block, and change the dropdown menu to the second scene backdrop. To stop this code from running, click control, and drag out a “stop” block.

Click the dropdown, and select “other scripts in the stage.” This will stop all the code that’s running on the stage. Okay, that was the last problem. Test your code!

Great! The lightning stops flashing, and you’ve successfully programmed a new backdrop for your story’s second scene and solved all of the problems created by the backdrop change! Now it’s your turn: 1) Select a backdrop for the second scene, and program it to change at the end of your story.

2) Fix the problems that came up when you changed the backdrop. Make the rain stop, hide the earth sprite, fix the bugs in the lightning, and make the story switch back to the original backdrop.

Use your persistence to solve these problems one at a time!

Choisir une extension
Réaction face aux éclairs
Dans cette extension, tu vas programmer les personnages dans ton histoire pour qu’ils réagissent lorsque les éclairs frappent.
Dessiner et animer un éclair
Dans cette extension, tu vas dessiner et programmer un éclair contrôlé par l'utilisateur qui glisse du ciel vers le sol.
Le soleil brille
Dans cette extension, tu vas programmer une deuxième scène pour ton histoire sous une journée pluvieuse.
Dans cette extension, tu vas jouer des sons de tonnerre et de pluie dans ton histoire.
Tremblement de terre
Dans cette extension, tu vas programmer un tremblement de terre pour vraiment secouer ton histoire.
Coder un arc-en-ciel
Dessine un arc-en-ciel et programme son apparition dans ton histoire sous la pluie !
arrow_backward Retour
Suivant arrow_forward
  1. Choisis une extension, et clique sur "Regarder" pour découvrir comment la créer.
  2. Une fois que tu as terminé une extension, essayes-en une autre !