TextWorld: Simple 2D terminal action game

A completed TextWorld Lab

TextWorld is a simple 2D action game that is played in the terminal/console. The player collects items while avoiding a monster. The game is written in Python3. I use it as a lab for my students to explore how to create a simple game.

The students are given a minimal working sample of the game. In this sample, the player can only move left and right. The students then need to add in code so it turns into a fully functioning game.

What is given to start

In order for the game to be fully functioning, the students need to do the following tasks:

  1. Make the player move up and down
  2. Make the player stay on the screen
  3. Make a wall around the playing area
  4. Create an item for the player to collect
  5. Add a score
  6. Add a monster

For the students that finish the lab early, I encourage the students to add things to make the game more interesting. Some extra things students have added in the past include powerups like extra health, teleporters, and wrap around (ex. going off the screen on the left side makes the player appear on the right side)

Before students can start this lab, they should know selection statements and loops.

My students really enjoyed doing this lab and had a lot of fun. I hope your students enjoy it too. Let me know how the lab worked for you in the comments below.

I have included the lab description as well as the source code for the minimum work sample.

The source code is released under the MIT License. The lab is released under the Creative Commons Attribution ShareAlike 4.0 International License.

You can download the files here.
Github repository is here.


If you like my work, a small donation or feedback will be much appreciated.

Buy Me a Coffee at ko-fi.comBuy Me A Coffee

Leave a Reply

Your email address will not be published. Required fields are marked *