I just started poking around with Python recently, and I decided to do a text-adventure game project to practice some of the core concepts. Trying to think of ways to go about it, I stumbled on this DaniWeb post:
Gave me a lot of inspiration, and I took my main layout from that. Wonderful practice! So thanks to everyone who contributed to that thread. Hope you don't mind I borrowed some pieces of the code skeleton from there.
In any case, I'm about done with the adventure, but there are some minor (So far non-fatal) problems I've run into. The game is mostly playable, unless it has some errors I don't know about, which is more than likely.
I've sorted out most of the problems I've run into myself, but one thing I can't figure out is:
The "quit" option works just fine in the first few rooms. Then it starts screwing up a bit, looping once before quitting. I can't figure out where it starts to go screwy, except that it always messes up after you've entered the Fungal Garden. Seems like that's not always the case, though.
The looping becomes increasingly worse with each new room you go into when you try to quit from there. For example, if you try to quit in the sept, "Press Enter to Quit" loops once, but you can still quit. If you try to quit in, say, the last room of the game, you get an infinite loop.
I've been over the whole thing again and again, but I just can't find what the problem is.
I hope you guys will be willing to play-test / help me debug!
Any other comments on the code, suggestions on things to add or take out, and general advice would be greatly appreciated. Thanks!
Code can be found here: http://www.mediafire.com/?xfn1ngn1gdp
(Attempted) features include:
1) Linked puzzles and brain-teasers
2) Two tricky insta-kills
3) Exciting sorta-combat!
4) A womanizing, alcoholic protagonist
5) 11 rooms
Thanks for your help and patience.