Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
88
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. from random import randrange
  3.    
  4.  
  5. class GameOver(object):
  6.    
  7.     death = ["\nGET REKT.", "\nBITCH PLEASE", "\nGG NUB", "\nKYS", "\nYOU SUCK",
  8.     "\nCOME ON", "\nWHY THE FUCK DID YOU DO THAT?", "\nARE YOU EVEN TRYING?"
  9.     ]
  10.    
  11.     def start(self):
  12.         print(self.death[randrange(0, len(self.death))])
  13.         exit()
  14.        
  15.        
  16. class Scene1(object):
  17.     def start(self):
  18.         print("\nScene1 description")
  19.    
  20.         action = input("\n>")
  21.    
  22.         if action == "1":
  23.             print("\nScene1 Outcome1 description")
  24.             game = Engine("Scene2")
  25.    
  26.         else:
  27.             print("\nScene1 Outcome2 description")
  28.             game = Engine("GameOver")
  29.    
  30.  
  31. class Scene2(object):
  32.     def start(self):
  33.         print("\nScene2 description")
  34.    
  35.         action = input("\n>")
  36.    
  37.         if action == "1":
  38.             print("\nScene2 Outcome1 description")
  39.             game = Engine("Scene3")
  40.            
  41.         else:
  42.             print("\nScene2 Outcome2 description")
  43.             game = Engine("GameOver")
  44.            
  45.            
  46. class Scene3(object):
  47.    def start(self):
  48.         print("\nScene3 description")
  49.    
  50.         action = input("\n>")
  51.    
  52.         if action == "1":
  53.             print("\nScene3 Outcome1 description")
  54.             print("YOU WON")
  55.             exit()
  56.    
  57.         else:
  58.             print("\nScene3 Outcome2 description")
  59.             game = Engine("GameOver")
  60.            
  61.  
  62. class Engine(object):
  63.     def __init__(self, scene):
  64.         self.scene = scene
  65.        
  66.         if self.scene == "GameOver":
  67.             game = GameOver()
  68.             game.start()
  69.        
  70.         else:
  71.             scenes = {
  72.             "Scene1": Scene1(),
  73.             "Scene2": Scene2(),
  74.             "Scene3": Scene3(),
  75.             }
  76.             while self.scene in scenes:
  77.                 game = scenes.get(self.scene)
  78.                 game.start()
  79.                
  80.                
  81. game = Engine("Scene1")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement