The Python Game Book

code games. learn Python.

User Tools

Site Tools




step 001 - the idea

It is not necessary to learn a programming_language before writing your first game, but it is a very good idea indeed. The language of choice for this book is Python, but that should not hinder you to take a look into other programming languages. In fact, your first game will need no programming language at all, just an idea.

the idea

Let's imagine a very straight-forward adventure game, where the player is faced with a situation and has to choose one of several possible actions. The decision of the player leads to a new situation, possibly ending the game. Let say we put the player in the role of young knight Sir Robin, facing an giant angry dragon and has three possible options:

Depending on the players choice, you confront him with a new situation. Let's say:

player's choice outcome
player stand still: dragon wait (same situation)
player fight the dragon: dragon runs away (new situation)
player run away: dragon eat player (game over)

While the first choice lead to exactly the same situation as before (just more boring for knight & dragon), the second choice lead to a new situation (let's say the player hears a cry for help from a princess waiting to be rescued). The third choice ends the game.

Let's visualize the idea of the game on paper:


realisation of the idea

How to realize the idea of a game ?
You can do that in several ways:


Just take 2 human players, promote one to the “game master” tasked with reading or making up situation descriptions and possible actions, while the other player “play” the game and choose one of the possible actions for each situation.
Sound simple ? Be assured that Dungeons & Dragons found a million-dollar industry out of this idea.

paper (gamebook)

Better suited for single players is to write all situation descriptions in a book where you give each situation a unique number (or page number). List every possible action below each situation description and write beside each action on what (page)number the reader should continue to read if he choose this action.

If interested, ask in your local library for gamebook's like the Fighting_fantasy series by Steve Jackson and Ian Livingstone

wiki game

such games are rapidly made inside a wiki. All you need is to know how to create & edit pages in a wiki and how to make hyperlinks.
Here in this dokuwiki, you can use the buttons at the right of your screen to edit or create a page1). Dokuwiki's commands are listed in the Formatting Syntax, but all you really need to know is

how to make an hyperlink:

[[pagename|Visible clickable text]].

It is also useful to know that 2 spaces and a star and a space make a bullet-list line:

  * first listitem
  * second listitem

Play and enhance The DokuWiki Dragon Adventure Game:


impress / powerpoint

If you have openoffice or microsoft_office installed on your computer, you can create a simple adventure game using the office software's presentation program, impress or powerpoint. Add on extra slide for each situation description and create hyperlinks leading to the corresponding slide.


things to know


/ /

you may need to login or register first
en/secret/people/jens_horst/part1step001.txt · Last modified: 2020/05/03 21:35 by horst