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 Add Another Level

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 stops 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 0.

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 8, you can try making the distance move at 8 + level. That way, at the first level, the cave moves at a speed of 8 + 1 or 9, and on the second level, the cave moves at 8+ 2 or 10, etc.

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 1, so add the “set level to” block at the beginning of the game and make sure it’s set to 1.

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 1” block in 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 1 to the level, and restart the game. Let's see if that works!

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!