text adventure game problem
gagsl-py2 at yahoo.com.ar
Mon Apr 14 11:59:12 CEST 2008
En Fri, 11 Apr 2008 11:21:17 -0300, <corvettecraz92 at gmail.com> escribió:
> On Apr 11, 10:16 am, corvettecra... at gmail.com wrote:
>> On Apr 11, 1:40 am, Dennis Lee Bieber <wlfr... at ix.netcom.com> wrote:
>> > On Thu, 10 Apr 2008 05:06:42 -0700 (PDT), corvettecra... at gmail.com
>> > declaimed the following in comp.lang.python:
>> > > okay, that explains it...
>> > > could you provide a working example of a two-room game using your
>> > > method please so I can understand it better? Thanks in advance!
>> > <sigh> Okay... It isn't the best thought out system -- I have
>> > many specific classes... It would probably be better to put actions
>> > dictionaries and use some custom .getattr() to handle them.
>> > #
>> > # TAGS.py Text Adventure Game Shell
>> > #
>> > # I've probably defined too many special classes here
>> > class Gobject(object): #Game object
>> > def __init__(self, name, description, hidden=False, fixed=True):
>> > self._name = name
>> > self._description = description
>> > self.hidden = hidden #hidden objects are not visible to
>> > EXAMINE
>> I still can't run that....after fixing the simple stuff like 'invalid
>> syntax', there's the "Name examine is not defined."
You will have to manually fix the long lines that were splitted/wrapped by
the mailer program. As a rule-of-thumb, try joining any line (inside a
function or class) that you see over the left margin, onto the previous
By example, the EXAMINE word above should be the last word on its previous
line, in fact it's part of the comment.
More information about the Python-list