uottawamakermobile

Text-Based Game (complete)

Apr 8th, 2020
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.84 KB | None | 0 0
  1. ##Game: Grounded
  2. ##Storyline
  3. print("Hi Jafari, my name is Penny and I will be your game guide. The aim of this game is get you back safely to your house.")
  4. print("")
  5. print("")
  6.  
  7. print('''Last night you were shrunk to a very very small size (size of grass hopper). And you were beamed to the rear end of your backyard. You are now 100mm away from home.
  8.  
  9. Yes I know!!! That's a fancy backyard you got pal. You were a rich kid with a huge backyard.
  10.  
  11. That was great for you when you were a full size pampered kid who was born with a silver spoon. Not so lucky for this tiny human that you are now. Hahaha.
  12.  
  13. With these tiny legs it will take you one whole day to get to your house where you have the machine that can return you back to your normal size.
  14.  
  15. Danger is imminent. You can get eaten by almost everything.''')
  16.  
  17. print("")
  18. print("")
  19.  
  20. print("Here are some helpful information")
  21. print('''The sun sets in 8h and it's impossible to survive in the dark.
  22.  
  23.    ---Walking to your house in a straight line will take you 8h.
  24.    
  25.    ---You run twice as fast as you walk (not exaclty Usain Bolt huh!!)
  26.    
  27.    ---However you only have stamina to run for 1h at a time
  28.    
  29.    ---After running for 2h you need to drink or else you faint
  30.    
  31.    ---You can walk for 8h without drinking
  32.    
  33.    ---A weapon can protect you agains any predator''')
  34.  
  35. print("<----------------------------------------------------------------------------------------------------------------------------------------------------->")
  36. print("")
  37. print("Your time starts now...")
  38. print('***********Good Luck Jafari***************')
  39. print('PS: Feel free to NOT contact me if you need me')
  40. print("")
  41.  
  42. ##Start with an empty backpack
  43. backpack = ('')
  44.  
  45. ##Solution for the game is in this sequence     ( weapon--> water -->run )
  46.  
  47. ## save reply of user in answer
  48. answer = input('''You are 30min walking distance from the closest water source and also 45min from the closest weapon. They are in two different direction.
  49. What is your priority? (water/weapon)''')
  50.  
  51. ##Starts the if, else statement of the game
  52. if answer.lower().strip() == 'weapon':
  53.     answer = input("What's your next priority? (house/water)")
  54.    
  55.     if answer.lower().strip() == 'water':
  56.        
  57.         answer= input("Do you run or walk to the water source? (run/walk)")
  58.  
  59.         if answer.lower().strip() == 'run':
  60.             print("Good job Jafari. Well done :)")
  61.  
  62.         else:
  63.             print ("This is no walk in the park. You are surrounded by deadly animals. Game over.")
  64.  
  65.                
  66.     else:
  67.         print ("Good luck reaching your house without fainting due to dehydration. Game over")
  68.        
  69. elif answer.lower().strip() == 'water':
  70.     print("Sorry dude. You were eaten by a cockroach on the way to quenching your thirst. Game over")
  71.    
  72. else:
  73.     print("Invalid choice")
Add Comment
Please, Sign In to add comment