Thanks to Luke for pointing out that Room1() did not return anything.
I now add a return statement:
9) have the functions return text rather than printing it. Use triple
quoted text. e.g.:
def Room1():
description = """You find yourself in a large room. Above you is a
massive crystal
cha
"kevin hayes" wrote
Hi all! I'm trying to write a basic text adventure game to start
learning
python (just for fun). I've gone through the first four chapters of
a "learn
python game programming book" and I'm having trouble with the
exercise on
writing a text adventure.
Sorry I don't know
On 8/27/2010 9:42 PM, kevin hayes wrote:
Hi all! I'm trying to write a basic text adventure game to start
learning python (just for fun). I've gone through the first four
chapters of a "learn python game programming book" and I'm having
trouble with the exercise on writing a text adventure. I
Now, I'm no pro at programming in Python, but here's what I recommend you
do. I would have a class at the beginning to define all of the rooms, and
then have the rest of the code below that. Then, it makes it easier to
follow. In addition, I would also have a function that stores the name of
the ro
Hi all! I'm trying to write a basic text adventure game to start learning
python (just for fun). I've gone through the first four chapters of a "learn
python game programming book" and I'm having trouble with the exercise on
writing a text adventure. I've been piecing together what is in the book