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 'til the players sprite explodes when touching the walls of the cave.

One way to make a sprite explode, is through costume changes.

For example, there's 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, if the parrot is touching color black, switch the costume to Explosion, then say you lose and stop everything.

Test your code.

Great.

This 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.

Now it's your turn.

Use the switch costume to block to make an explosion happen when the sprite hits the wall.

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!
Attributions
  • The song “Magic Marker” is © YouTube-- CC-BY-SA 4.0 does not apply.