<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | In the above function, there's the option to examine a cabinet and get | 8 gold. (everyone here knows that...but I'm just trying to state my | problem...) | Unfortunately, it kind of doesn't work. | After the first time I 'examine cabinet 1' in my game, I get 8 gold | and I can't get it again. | But, If I leave the room and come back to it, then it's as if I had | never gotten the gold the first time, and I can get it again. | How do I fix this?
I would define a container class. The init function gives it a name and contents (8 gold, for instance). Give kitchen a container('cabinet', 8). Give containers a .examine() method which gives the contents to the player. and a message which varies with the contents. You can even make some container 'refreshable' if you want. tjr -- http://mail.python.org/mailman/listinfo/python-list