Advertisement
Guest User

Untitled

a guest
Feb 21st, 2013
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.01 KB | None | 0 0
  1. from sys import exit
  2.  
  3. inventory = []
  4.  
  5. def start_menu():
  6.     print "Leverage: A Journey Through the Mind"
  7.     print "Use 'examine', 'enter', 'get', and 'return' to navigate."
  8.     print "'start' to begin."
  9.     print "'exit' to exit."
  10.    
  11.     response = raw_input("> ")
  12.    
  13.     if response == "start":
  14.         return room_one
  15.        
  16.     elif response == "exit":
  17.         exit(0)
  18.    
  19.     else:
  20.         print "Well, make up your mind."
  21.        
  22. def room_one():
  23.     print 'You wake up in an uncomfortable bed.'
  24.     print 'Upon furthur investigation, you find a light switch.'
  25.     print 'Lit up by the bare bulb hanging from the ceiling, the room is revealed.'
  26.     print 'It contains a dusty bed and an old nightstand.'
  27.     print 'There is no door.'
  28.        
  29.     next = raw_input("> ")
  30.    
  31.     if "examine" in next and "bed" in next:
  32.         print 'It is a very dusty bed with a you-shaped imprint.'
  33.         print '                                                 '
  34.         return room_one
  35.        
  36.     elif "examine" in next and "nightstand" in next:
  37.         return nightstand
  38.    
  39.  
  40.    
  41. def nightstand():
  42.     print 'An old nightstand with cracked and peeling paint.'
  43.     print 'There are two drawers, one on top of the other.'
  44.     print 'A rusty hatchet lies on top of the nightstand.'
  45.    
  46.     next = raw_input("> ")
  47.        
  48.     if "examine" in next and "top" in next:
  49.         print 'The top drawer opens to reveal a cheery scene.'
  50.         print 'It appears to be a residential street in the 1950s.'
  51.         print 'The sun is shining and children are playing.'
  52.         return top_drawer
  53.        
  54.     elif "examine" in next and "bottom" in next:
  55.         print 'The bottom drawer opens to reveal a small cottage.'
  56.         print 'The opening in the drawer seems to be under a table in the kitchen.'
  57.         print 'Everything is covered with a thick layer of dust,'
  58.         print 'and little light seeps in through the windows.'
  59.         return bottom_drawer
  60.        
  61.     elif "get" in next and "hatchet" in next:
  62.         inventory.append('hatchet')
  63.         return nightstand
  64.    
  65.     elif "return" in next:
  66.         return room_one
  67.        
  68.     else:
  69.         print "What?"
  70.         print "     "
  71.         return nightstand
  72.    
  73.        
  74.        
  75.        
  76. f = start_menu
  77. while f:
  78.     f = f()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement