Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more.

Transcript

Right now, when a user reaches the finish line, the game ends.

In this add-on, you'll create additional levels where the player must go through the cave at a faster speed than before.

Now the game starts after a player wins.

So you first need to remove the stop all after saying you win.

You also need to tell the player that the game isn't over when they reach the finish line.

Instead of saying you win, it should let the user know the game continues by saying something different.

For example, you win at this level, get ready for the next one.

Then the game needs to reset.

This means distance traveled should go back to zero.

Now, in order to change the game difficulty based on level of play, it's important to keep track of which level the player is on.

You can use a variable to do this.

Remember, a variable is a storage container for values.

To keep track of level, use a variable.

Call it level, and let all sprites see it.

To make the game get faster as the player progresses through levels, change the number in that variable so it rises as the level changes.

For example, instead of eight, you can try making the distance move at eight plus level.

That way, at the first level, the cave moves at a speed of eight plus one, or, nine.

And on the second level, the cave moves at eight plus two, or, 10, et cetera.

There are still a few things that need to happen to make this game progress through the levels correctly.

First, it's a good idea to start a variable with a base value.

The game should start at level one.

So at the set level to block, at the beginning of the game, and make sure it's set to one.

The game also needs to increase by one level every time the user hits the finish line.

The user reaches the finish line when the parrot touches the color green.

Place the change level by one block and the if touching color green block.

Now, when the parrot touches green, it should let the user know they're going to the next level, add one to the level, and restart the game.

Let's see if that works.

Now it's your turn.

Change the code so that the user doesn't win when the sprite hits the finish line, and instead, has a chance to go through a faster maze.

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.

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.