Text Adventure Games

In text adventure games, the game tells you what’s happening, and you tell the game what your character should do next. The game responds, and you respond, and so on.

Here’s an example of what a text adventure game might look like:

Welcome to Cheesecake Quest!

What is your name?
>Nemo

Welcome to Cheesecake Land, Nemo.

You are standing outside a restaurant.
You see the restaurant entrance to the north.
Main Street stretches to the east and west.
Exits: [north] [east] [west]

>north

You open the door and walk into the restaurant.
You can look at the [menu] or [order] food.

>menu

The following items are available:

[peanut butter] cheesecake
[chocolate] cheesecake
[raspberry] cheesecake

>order

What would you like to order?

>peanut butter

You have acquired peanut butter cheesecake.

Text adventure games can have a lot of interesting elements:

  • Story / flavor / themes
  • Quests
  • Puzzles
  • Map
  • Cities
  • Items / inventory
  • Stores / buying / selling / money
  • Experience / levels / new abilities
  • Enemies / bosses / combat
  • Shops / buying / selling
  • NPC’s (non player characters)

The great thing about programming an adventure game is that it’s fun while also being a good way to learn many computer science concepts. If you can pick a game concept that you like and keep adding to it over time, you can achieve a lot of growth as a programmer.

You should start simple and attempt to add one small thing at a time.

Don’t be afraid to take a couple of steps back and change the way you’re structuring your game if you think of a better way to organize your code. This is part of the learning process. As you accumulate more tools (functions, lists, objects, etc), you will hopefully start seeing better ways of doing things.