Advertisement
Guest User

helper.py

a guest
Dec 16th, 2013
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.39 KB | None | 0 0
  1. #-------------------------------------------------------------------------------
  2. # Name:        helper
  3. # Purpose:     To contain helper functions for the game "Yoy wake up..."
  4. #
  5. # Author:      William
  6. #
  7. # Created:     17/12/2013
  8. # Copyright:   (c) William 2013
  9. #-------------------------------------------------------------------------------
  10.  
  11. import time
  12. import assci
  13. import main
  14.  
  15. #Error message if user executes the wrong file.
  16. if __name__ == '__main__':
  17.     print("[ERROR]: Do not run this file. Run main.py - this file should not be executed!")
  18.     time.sleep(4)
  19.     exit()
  20.  
  21. #Function for the first quest: do you want to find a way out?
  22. def way_out_quest():
  23.     """
  24.    If the question is not answered, then the player can't move on. If they say
  25.    yes, then they continue through the script. If they say no, then the init
  26.    function is called from main.py
  27.    """
  28.     way_out_answered = False
  29.     while way_out_answered == False:
  30.         WAY_OUT_INPUT = input("Quest: Do you want to find a way out? ")
  31.         if WAY_OUT_INPUT in ["yes", "Yes", "YES"]:
  32.             way_out_answered = True
  33.  
  34.         elif WAY_OUT_INPUT in ["no", "No", "NO"]:
  35.             way_out_answered = True
  36.             time.sleep(2)
  37.             assci.clear()
  38.             print("GAME\nOVER!")
  39.             time.sleep (5)
  40.             assci.clear()
  41.             main.init()
  42.  
  43.         else:
  44.             print("Type yes or no. ")
  45.  
  46.         time.sleep(4)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement