New “Choose Your Own Adventure” Game

Having a “Choose Your Own Adventure” style game for readers to look at was suggested to me, so I quickly wrote one up. The code is designed to be very simple, despite its length. There is no accompanying chapter, but I do provide a short description page.

The source code:

http://inventwithpython.com/extra/dragon2.py

The description page:

http://inventwithpython.com/extra/dragon2.html

These links are also on the Extras page on the main site.

2 comments on this post.
  1. Travis McCrea:

    how hard would it be to integrate images into this? I was thinking like a background image per each option?

    also I got this error:
    teamcoltra@paradoxicon ~/Downloads $ python ‘/home/teamcoltra/Downloads/dragon2.py’
    File “/home/teamcoltra/Downloads/dragon2.py”, line 6
    print(’1 to ‘ + str(numberOfPaths) + ‘> ‘, end=”)
    ^
    SyntaxError: invalid syntax

  2. Al Sweigart:

    Thanks for the comment, Travis. I have since fixed that bug in the dragon2.py file that you mentioned. Thanks again!

Leave a comment