Advertisement
python_games

Python ghost game (.py)

Dec 16th, 2017
991
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. # Cades ghost game, created by python_games and DK community
  2. #Just paste this into a python IDLE window, and tweak if you are professinal!
  3. from random import randint
  4. from time import sleep
  5.  
  6. print("Cades ghost game!")
  7. feelingbrave = True
  8. score = 0
  9. while feelingbrave:
  10. ghostdoor = randint(1, 3)
  11. print("Three doors are ahead...")
  12. sleep(1)
  13. print("One has a ghost in it!!!")
  14. sleep(0.5)
  15. print("You have to open one, which one?")
  16. door = input('1, 2, or 3?')
  17. doornum = int(door)
  18. if doornum == ghostdoor:
  19. print("GHOST!!!")
  20. feelingbrave = False
  21. else:
  22. print("No ghost")
  23. sleep(0.5)
  24. print("Go to next level!")
  25. score = score + 1
  26. print("You ran away!")
  27. sleep(1)
  28. print('Game over! you scored', score, "!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement