title: Getting two class game to interact
body: <p>So I know this site gets far too many questions about Zed Shaw's Learn Python the Hard Way, but I'm going through ex42., extra credit #3, has got me hung up.</p>
  
  <p>I am having trouble getting the class Engine to effectively start and transition into the class Map where the game can begin going through the different functions that I have defined</p>
  
  <p>the code is as follows:</p>
  
  <pre><code>from sys import exit  
  from random import randint
  
  class Map(object):
  
      def death(): 
          print quips[randint (0, len(quips)-1)]
          exit(1)
  
      def princess_lives_here():
          print "You see a beautiful Princess with a shiny crown."
          print "She offers you some cake."
  
          eat_it = raw_input("&gt;")
  
          if eat_it == "eat it":
              print "You explode like a pinata full of frogs."
              print "The Princess cackles and eats the frogs. Yum!"
              return 'death'
  
          elif eat_it == "do not eat it":
              print "She throws the cake at you and it cuts off your head."
              print "The last thing you see is her munching on your face. Yum!"
              return 'death'
  
          elif eat_it == "make her eat it":
              print "The Princess screams as you cram the cake in her mouth."
              print "Then she smiles and cries and thank you for saving her."
              print "She points to a tiny door and says, 'The Koi needs cake too.'"
              print "She gives you the very last bit of cake and shoves you in."
              return 'gold_koi_pond'
  
          else:
              print "The Princess looks at you confused and just points at the cake."
              return 'princess_lives_here'
  
  
  class Engine(Map):
  
      def _init_(self, start):
          self.quips = [
              "You died. You suck at this.",
              "Your mom would be proud, if she were smarter",
              "Such a luser.",
              "I have a small puppy that's better at this."
          ]
          self.start = start
  
      def play(self):
          next = self.start
  
          while True:
              print "\n-----"
              room = getattr(self, next)
              next = room()
  
  e = "princess_lives_here".Map.Engine
  e.play()
  </code></pre>
  
  <hr>
  
  <p>Now the issue is not with the other functions within Map class but making the transition from the class Engine to class Map so the game can continue. It is either not defining 'Map' within the class Engine or in the variable i am setting up at the end and trying to run with the play() command.</p>
  
  <p>Any other links you can point me to in regards to class interaction would be great. thnx again</p>