1 of 14

Lesson 7

A Simple Text Adventure Game

2 of 14

Learning objectives

By then end of this lesson, you should be able to:

  • understand the assignment and how you will be marked
  • understand how this assignment allows you to demonstrate all you have learned about Python coding so far
  • start working on your assignment!

3 of 14

Assignment rubric

Text adventure games were popular in the 1980s and were sometimes referred to as “interactive novels”. Some of them also featured graphics to enhance the playing experience!

Check out the marking rubric here

(PDF, MS Word)

Keen for a competition? Play this game and see who is the first to successfully retrieve the package!

4 of 14

Some other examples to get you thinking...

5 of 14

Getting Starting - A simple 4 location “game”

Step 1: Drawing the Location Diagram

​

​

​

​

​

Instructions:

  • Watch the video above (3:47 min)
  • On paper, draw 2 large circles (make space for a 3rd circle later)
  • Fill them in with the details of the 2 locations in your sample game.

3:47 min

6 of 14

Getting Starting - A simple 4 location “game”

Step 2: Coding up the first location

​

​

​

​

​

Instructions:

  • Watch the video above (7:21 min)
  • While you are watching the video, code up your first location by adapting the code in the video

7:21 min

7 of 14

Getting Starting - A simple 4 location “game”

Step 3: Finishing the first location

​

​

​

​

​

Instructions:

  • Watch the video above(4:11 min)
  • Finish coding up your first location by adapting the code in the video.

4:11 min

8 of 14

Getting Starting - A simple 4 location “game”

Step 4: Coding the second location

​

​

​

​

​

Instructions:

  • Watch the video above(5:02 min)
  • Code up your second location by adapting the code in the video.
  • Playtest your game and check that it works!

5:02 min

9 of 14

Getting Starting - A simple 4 location “game”

Step 5: Coding the third location

​

​

​

​

​

Instructions:

  • Watch the video above (2:55 min)
  • Code up your third location by adapting the code in the video.
  • Playtest your game and check that it works!

2:55 min

10 of 14

Getting Starting - A simple 4 location “game”

Step 6: Adding a fourth and final location to our state diagram

​

​

​

​

​

Instructions:

  • Watch the video above (1:20 min)
  • Update your state diagram by adding a fourth location and make sure there are links and choices leading to it

1:20 min

11 of 14

Getting Starting - A simple 4 location “game”

Step 7: Coding the fourth location and finishing the game

​

​

​

​

​

Instructions:

  • Watch the video above (3:01 min)
  • Code up your fourth and final location by adapting the code in the video
  • Playtest your game and check that it works!

3:01 min

12 of 14

Sample Code to get you started

Sample Code to help you start�You can delete the code from the editor if you don’t need it!

13 of 14

Python Reference Sheet

Python Reference Sheet

​

    • Print it out, keep it handy and use it!
    • Get it here

14 of 14

License Information

These lessons plans, worksheets, and other materials were created by Code for Schools. They are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

​