Guest User

Untitled

a guest
Oct 15th, 2018
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.12 KB | None | 0 0
  1. # created on: Oct 15, 2018
  2. # Author: Win.thitiwat
  3.  
  4.  
  5. """
  6. Docstring Part
  7.  
  8. """
  9.  
  10. import time
  11. import sys
  12.  
  13. # ****************************
  14. #
  15. # Start Defining Key Variables
  16. #
  17. # ****************************
  18.  
  19. TIMER = [
  20. """
  21. ██████╗
  22. ╚════██╗
  23. █████╔╝
  24. ╚═══██╗
  25. ██████╔╝
  26. ╚═════╝
  27. """,
  28. """
  29. ██████╗
  30. ╚════██╗
  31. █████╔╝
  32. ██╔═══╝
  33. ███████╗
  34. ╚══════╝
  35. """,
  36. """
  37. ██╗
  38. ███║
  39. ╚██║
  40. ██║
  41. ██║
  42. ╚═╝
  43. """,
  44. """
  45.  
  46.  
  47. ███████╗████████╗ █████╗ ██████╗ ████████╗
  48. ██╔════╝╚══██╔══╝██╔══██╗██╔══██╗╚══██╔══╝
  49. ███████╗ ██║ ███████║██████╔╝ ██║
  50. ╚════██║ ██║ ██╔══██║██╔══██╗ ██║
  51. ███████║ ██║ ██║ ██║██║ ██║ ██║
  52. ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝
  53.  
  54.  
  55. """]
  56.  
  57.  
  58. MISSION = [[1, "Riddle Game (Testing your aptitude to help solve emergency problems)"],
  59. [2, "Cook for the King (within limited time amount)"],
  60. [3, ""],
  61. [4, ""]]
  62.  
  63.  
  64. RIDDLES_QUESTIONS_LIST = [["QUESTION", "ANSWER"],
  65. ["QUESTION", "ANSWER"]]
  66.  
  67. PLAYER_NOTEBOOK = [["EVENT"]]
  68.  
  69. KING_DRINK_RECIPE = ["Espresso", "Gingerbread syrup", "Milk", "Gingerbread spice"]
  70.  
  71. ALL_RECIPE = [""]
  72.  
  73.  
  74. player = {
  75. "player_name": "",
  76. "": "",
  77. "overall_current_score": 0,
  78. "done_mission": [],
  79. "undone_mission": []
  80. }
  81.  
  82. # ****************************
  83. #
  84. # End Defining Key Variables
  85. #
  86. # ****************************
  87.  
  88.  
  89. # **************************
  90. #
  91. # Start program controller
  92. #
  93. # ***************************
  94.  
  95.  
  96. def ascii_art_gen_timer():
  97. """ this function is used to display timer in ascii art format before bonus game starts"""
  98.  
  99. for each in TIMER:
  100. print("\r"+each)
  101. sys.stdout.flush()
  102. time.sleep(1)
  103.  
  104.  
  105. def set_player_name(name):
  106. player["player_name"] = name
  107.  
  108.  
  109. def get_player_name():
  110. return player.get("player_name")
  111.  
  112.  
  113. def set_player_score(result_condition, score):
  114.  
  115. if result_condition:
  116. player["current_score"] += score
  117. else:
  118. player["current_score"] -= score
  119.  
  120.  
  121. def get_player_score():
  122. return player.get("current_score")
  123.  
  124.  
  125. def get_player_info(info_type):
  126. if info_type == "all":
  127. return player
  128. return player.get(info_type)
  129.  
  130.  
  131. # ***************************
  132. #
  133. # End program controller
  134. #
  135. # ***************************
  136.  
  137.  
  138. # ***************************
  139. #
  140. # Start Game activity flow
  141. #
  142. # ***************************
  143.  
  144.  
  145. def game_stage1():
  146. pass
  147.  
  148.  
  149. def game_stage2():
  150. pass
  151.  
  152.  
  153. def game_stage3():
  154. pass
  155.  
  156.  
  157. def game_fail():
  158. pass
  159.  
  160.  
  161. def game_intro():
  162.  
  163. text = "Welcome to Python World\n"
  164. for each_char in text:
  165. print(each_char, end="")
  166. sys.stdout.flush()
  167. time.sleep(0.3)
  168.  
  169. for i in range(3):
  170. print(". ", end="")
  171. sys.stdout.flush()
  172. time.sleep(0.3)
  173.  
  174. print("\n\nExcuse me, what's your name...")
  175. player_name = str(input("I'm: "))
  176.  
  177. set_player_name(player_name)
  178.  
  179. print(f"Welcome ... {get_player_name()}\n")
  180.  
  181. time.sleep(2)
  182. print(f"""
  183. You are a prisoner under the ID 24601 who just broke a windowpane and stole a loaf of bread
  184. to feed your starving daughter. You were judged to be imprisoned for 15 years. Also, you know that your
  185. daughter has been looked after by a shady hotel's owner and you cannot wait to take her out!!!.
  186.  
  187. Luckily, at the 9th year of your imprisonment, you are pardoned by the King of our city and you are given
  188. with a good job in the Hult Palace.
  189. """)
  190.  
  191. input("\nPress Enter to continue...")
  192.  
  193. print(f"""
  194. Welcome to Hult Palace, you are cordially invited by the king to be in charge of his caretaker.
  195.  
  196. !!! But you need to PASS our intensive training first before starting the job!!!
  197.  
  198. The perk you will get from this job if you PASS our intensive training:
  199. 1. Out of the prison
  200. 2. Free Food/accommodation for your family in the Palace
  201. 3. Personal guards
  202. 4. Live like a king, but not
  203. 5. Lastly, you will find your DAUGHTER
  204.  
  205. *** HOWEVER, if you FAIL our training, you will be sent to Alcatraz prison for LIFE IMPRISONMENT ***
  206. """)
  207. input("\nPress Enter to continue...")
  208.  
  209.  
  210. def game_start():
  211.  
  212. pass
  213.  
  214.  
  215. def main():
  216.  
  217. # game_start()
  218. # temp = input()
  219. game_intro()
  220. input()
  221.  
  222. ascii_art_gen_timer()
  223.  
  224. if __name__ == '__main__':
  225. main()
  226.  
  227.  
  228. #for x in range (0,5):
  229. # b = "Loading" + "." * x
  230. # sys.stdout.write("\r" + b)
  231. # sys.stdout.flush()
  232. #
  233. # time.sleep(1)
Add Comment
Please, Sign In to add comment