Level 5: Bonus Challenge - IncrediCoders/Python1 GitHub Wiki

Intelli_Avatar_9

Intelli-Scents added this page on March 14, 2025


It's time for an extra challenge. This time you're going to create your own level designs!

To start this bonus challenge, open your completed Level 5 code and build your own levels by following along with my instructions below!

Creating Your Own Levels

In the Assets folder of Level 5, you’ll find the “LevelCustom.txt” file. This is going to be your template for building a level where you choose the obstacles.

First, you’ll need to change line 108 of the CreeperChase_Solution.py file. Currently it says:

Manager.run(SCREEN, WINDOW, BLUE, "MAIN")

Replace the “MAIN” argument with “BONUS” so that it looks like this:

Manager.run(SCREEN, WINDOW, BLUE, "BONUS")

(Keep in mind that you'll need to change BONUS to MAIN if you want to build the original level in the future.)

Now run the game, the level should look like this:

template

This is your template for building a custom CreeperChase level!

Let’s take a look at how to build a level. Open the LevelCustom.txt file in the Assets folder of Level 5. You should see a bunch of numbers.

txttemplate

We have the numbers 0-4 in this txt file. We’ve shown below what each number represents in your level.

  • 0 - Air Tile: Paul may walk through these tiles and will fall through them if open space is beneath him.
  • 1 - Brick Tile: Paul may walk on top of these tiles, but not through them.
  • 2 - Hazard/Fire Tile: Paul dies if he touches these tiles.
  • 3 - Exit Portal Tiles(s): This is the exit portal tile, whenever two 3s are stacked on top of each other, an exit portal will appear
  • 4 - Spawn Tile: Paul spawns wherever you put the 4

Let’s modify our template!

I’ve inserted a brick tile just to the right of where Paul spawns by replacing a 0 with a 1.

txttemplate1

Save and Run. This makes the level look like this:

template1

Now I’ve added a hazard tile in the air and created a dugout for Paul to pass the hazard tile. Keep in mind, I had to play with the spacing of the hazard tile and dugout in order to make sure Paul was actually able to get past this obstacle.

txttemplate2

This configuration looks like this:

template2

Now that we’ve used the main tiles for a level, you should able to modify this template and create some challenging levels!

You will use these numbers to design your own custom level:

  1. Delete numbers in the original file and replace them with the numbers (tiles) of your choosing.
  2. Make sure to save the file after you are done editing it.
  3. Test the level by playing the game. In videogame production, this is done by the developers and then is often done at scale by multiple people, in a process called Quality Assurance. As you play the game, take notes of all the changes you want to make. Return to Step 1 above, to refine your game level(s).

Special Note: In order to create the exit portal, there must be two 3's stacked vertically. The entrance portal, on the other hand, only requires one 4 to create (put the 4 two or three tiles above the surface). Each level should only have one entrance portal and one exit portal.

If you want to create more than one custom level, open any of the other level text files and repeat the process.

Next Steps

After you are finished creating your new text file, run the game to play your new level!

Next, you can take on the other challenges to add a time limit and to add batteries (health) to the game! When you're done, you can move on to Level 6, the Boss Battle!

Take the other Challenges!

Challenge 1: In this challenge, you are going to write code that will add a time limit for 45 seconds for each stage of the game.

Challenge 2: In this challenge, you are going to add batteries to the game. Paul collects the batteries to regain his health.

More Level 5 Resources

  • Level 5: Unplugged Activity - In this activity, you're going to test out videogame and velocity while physically moving through an obstacle course!

  • Level 5: Rewards - If you completed the Creeper Chase program that we talked about, then I set up this page to act as a reward. You can see some illustrations of me and learn more about who I am! You'll also find the **WHAT **Award digital download, to show off your accomplishment!

  • Level 5: Creeper Chase: All Online Articles - Return back to the main Level 5 page, with all our online resources!

Level 6

After you're completely done with Level 5 (did you do the challenges?), then it's time to move on to Level 6! While you read through Level 6 in your book, you can check out the resources from Paul Python, as he teaches you how to build the Boss Battle program:

I hope you had fun learning about the Creeper Chase game!

-- Intelli-Scents

⚠️ **GitHub.com Fallback** ⚠️