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 Dangerous Cave Walls

Transcript

When the bird runs into the walls of this game, the player loses. In this add-on, you’ll make it so the player sprite explodes when touching the walls of the cave.

One way to make a sprite explode is through costume changes. For example, there is already an explosion costume for the parrot in the starter project you remixed.

This “switch costume to” block switches to a specific costume.

If explosion is not the costume in the “switch costume to” block, click the drop-down menu, and change it to “explosion.”

The parrot should explode if it touches the edges of the cave. Cave edges are colored black, so, the “switch costume to explosion” block belongs inside an “if touching color black” block.

Now, this part of the program reads: Test your code.

Great! The sprite explodes when touching the cave walls. You may want to add a sound that will play when this happens, or use a “repeat” block with a “change size” block to make the sprite get bigger when it explodes. Exploring fun customizations like this is one of the best parts of computer science, and it’s a great way to make your game more interesting and fun to play.

Choose an Add-On
Make Your Own Music
Add a drum beat and background music to your game.
Add Another Cave Section
Design a new cave sprite with black edges and add it to your game.
Make the Game Harder
Make the player press the spacebar over and over to keep the sprite in flight.
Dangerous Cave Walls
Make the player sprite explode when it touches the walls of the cave.
Add Another Level
Create additional game levels that get faster and harder as the player progresses.
Dive!
Make the sprite dive, or move down faster than it falls.
arrow_backward Back
Next arrow_forward
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!