class Timed(object): # This is a self timing game. It takes the start time and takes the end time from it def __init__(self, more): self.names = more self.gold = Gold(self.names) self.death = Death("You forever burn in hell.") self.test1 def test1(self): sleep(0.5) print "\033[34m%r\033[0m You enter a room with a button on a pillar right in the middle of the room" % self.names sleep(0.5) print "There are a set of instructions. You will need to press the button" sleep(0.5) print "Then count in your head to ten then press the button again." self.begin = raw_input("Press enter ") self.start = time.time() enter = raw_input("Press enter again after 10 seconds ") self.finish = time.time() end = int(self.finish) - int(self.start) if end <= 9: print end return self.death.dead() # This gives you a bit of wigal room so you can go over by a few seconds elif end >= 10 and end <= 12: sleep(0.5) print "Wow you done it. You can count lol." sleep(0.5) print "Here is your reward." sleep(1) return self.gold.gold() else: return self.death.dead()
def __init__(self, more): self.names = more self.death = Death( "Looks like the lock died, You curl up in a ball and await death.") self.first_two = "[%r:%r: ]" % (random.randint( 1, 10), random.randint(1, 10)) self.sums = Sums(self.names)
def postInit(self): # # initialize game content # # camera base.camLens.setNearFar(1.0, 10000) base.camLens.setFov(75) a = 33 base.camera.setPos(0, -a, a + 3) #80) # collision base.cTrav = CollisionTraverser("base collision traverser") base.cHandler = CollisionHandlerEvent() base.cPusher = CollisionHandlerPusher() base.cQueue = CollisionHandlerQueue() base.globalClock = ClockObject.getGlobalClock() base.cHandler.addInPattern('%fn-into-%in') base.cHandler.addOutPattern('%fn-out-%in') base.cHandler.addAgainPattern('%fn-again-%in') # ai init base.AIworld = AIWorld(render) # 3d manager base.audio3d = Audio3DManager(base.sfxManagerList[0], camera) # manager self.archiveManager = ArchiveManager() self.mapManager = MapManager() self.initHeroInfo = None # Lock self.lock = threading.Lock() self.gameThread = None self.filters = CommonFilters(base.win, base.cam) # UI self.menu = Menu() self.option = Option() self.archive = Archive() self.death = Death() # self.oobe() #self.Archive_status = 0 # self.menuMusic = loader.loadMusic("assets/audio/menuMusic.ogg") # self.menuMusic.setLoop(True) # self.fightMusic = loader.loadMusic("assets/audio/fightMusic.ogg") # self.fightMusic.setLoop(True) # base.audio3d = Audio3DManager(base.sfxManagerList[0], camera) self.titleVideo, self.titleCard = loadVideo('title.mp4') self.isInited = False self.isSkip = False self.isRenew = False # # Event handling # self.accept("escape", self.__escape) # # Start with the menu # self.request("Menu")
def move_on(self, next_room, story_tag, action_tag): "moves the game into the next scene" if next_room == 'consciousness_link': cl = ConsciousnessLink() cl.enter(story_tag, action_tag) else: dt = Death() dt.enter(story_tag, action_tag)
def move_on(self, next_room, story_tag, action_tag): "moves the game to the next scene, the waste center" if next_room == 'waste_center': wc = WasteCenter() wc.enter(story_tag, action_tag) else: dt = Death() dt.enter(story_tag, action_tag)
def move_on(self, next_room, story_tag, action_tag): "moves the game into the next scene" if next_room == 'power_center': pc = PowerCenter() pc.enter(story_tag, action_tag) else: dt = Death() dt.enter(story_tag, action_tag)
def move_on(self, next_room, story_tag, action_tag): "moves the game into the next scene" if next_room == 'cortex_vault': cv = CortexVault() cv.enter(story_tag, action_tag) else: dt = Death() dt.enter(story_tag, action_tag)
def move_on(self, next_room, story_tag, action_tag): "moves the game into the next scene" if next_room == 'victory': vt = Victory() vt.enter(story_tag, action_tag) else: dt = Death() dt.enter(story_tag, action_tag)
def create_deaths(wof_settings,screen,deaths,levelMap): """ Create a set of deaths """ death_width = wof_settings.element_width death_height = wof_settings.element_height # Create deaths for death_position in levelMap['death']: death = Death(wof_settings,screen) death.x = death_position[1] * death_width death.y = death_position[0] * death_height death.rect.x = death.x death.rect.y = death.y deaths.add(death)
class Map(object): scenes = { 'the_beginning': S.TheBeginning(), 'fire_room': S.FireRoom(), 'lit_hole': S.LitHole(), 'locked_door': S.LockedDoor(), 'two_paths': S.TwoPaths(), 'two_choices': S.TwoChoices(), 'doors_room': S.DoorsRoom(), 'tunnel': S.Tunnel(), 'dark_hole': S.DarkHole(), 'hallway_end': S.HallwayEnd(), 'death': Death(), # raise ValueError ('todo') #Add more scenes } # initializes to a starting scene def __init__(self, start_scene): self.start_scene = start_scene # gets the specified scene from the scenes dictionary list. def next_scene(self, scene_name): return self.scenes.get(scene_name) # gets the first scene of the map from the dictionary list def opening_scene(self): return self.next_scene(self.start_scene)
class Map(object): scenes = { 'Room': S.Room(), 'Elevator': S.Elevator(), #this connects names to scenes 'Extra_lock': S.Extra_lock(), 'text': S.text(), 'Friend_solo': S.Friend_solo(), 'Reentry_solo': S.Reentry_solo(), 'Reentry_friend_good_txt': S.Reentry_friend_good_txt(), 'Reentry_friend_bad_txt': S.Reentry_friend_bad_txt(), 'death': Death() # raise ValueError ('todo') } # initializes to a starting scene def __init__(self, start_scene): self.start_scene = start_scene #self is the variabel # gets the specified scene from the scenes dictionary list. def next_scene(self, scene_name): return Map.scenes.get(scene_name) # gets the first scene of the map from the dictionary list def opening_scene(self): return self.next_scene(self.start_scene)
class Map(object): scenes = { 'wake_up': S.WakeUp(), 'door_one': S.DoorOne(), 'door_two': S.DoorTwo(), 'bridge_door_one': S.BridgeDoorOne(), 'cyclops_room': S.CyclopsRoom(), 'collapsing_tunnel': S.CollapsingTunnel(), 'cliff': S.Cliff(), 'bridge_door_two': S.BridgeDoorTwo(), 'death': Death(), # raise ValueError ('todo') } # initializes to a starting scene def __init__(self, start_scene): self.start_scene = start_scene # gets the specified scene from the scenes dictionary list. def next_scene(self, scene_name): return Map.scenes.get(scene_name) # gets the first scene of the map from the dictionary list def opening_scene(self): return self.next_scene(self.start_scene)
class Map(): #translates the strings we receive as returns to which function to call next scenes = { 'birth': Birth(), 'grove': Grove(), 'metropolis': Metropolis(), 'death': Death(), 'doorway': Doorway(), 'forest': Forest(), 'plains': Plains(), 'elfkingdom': ElfKingdom() } #we provide a place to start def __init__(self, start_scene): self.start_scene = start_scene def next_scene(self, scene_name): val = Map.scenes.get(scene_name) return val #plays the first scene in the game def opening_scene(self): return self.next_scene(self.start_scene)
def __init__(self, more): # This sets the HP and attacks for you and who you are fighting in this class also takes the name from the start.py file and adds it in here self.HP = 100 self.names = more self.death = Death("So he kicked you're ass then.") self.pikachuhp = 20 self.mewhp = 30 self.mewtwohp = 40 self.hitback = random.randint(5, 20)
class Map(object): #key is strings, value is function scenes = { 'central_corridor': S.CentralCorridor( ), # class names bc they're capitalized. calling class name __init__. String keys are assigned to the scene object. They're scene objects because () calling the constructorn function inside class 'laser_weapon_armory': S.LaserWeaponArmory(), 'guards': S.Guards(), 'foot_steps': S.Foot_Steps(), # Hallway Path 'hallway': S.Hallway(), 'infirmary': S.Infirmary(), 'storage': S.Storage(), 'box': S.Box(), 'escape': S.Escape(), 'ask': S.Ask(), 'boarding': S.Boarding(), 'incoming': S.Incoming(), # Others Path 'others': S.Others(), 'pub_Entrance': S.Pub(), 'poker': S.Poker(), 'winnah': S.Winnah(), # Exit 'exit': S.Exit(), # Death 'death': Death() # raise ValueError ('todo') } # initializes to a starting scene def __init__(self, start_scene): # this is the constructor self.start_scene = start_scene # gets the specified scene from the scenes dictionary list. def next_scene(self, scene_name): # sending in scene_name, self.start_scene is assigned as scene_name SAME VALUE THO return self.scenes.get(scene_name) # self.scenes in this line gets # gets the first scene of the map from the dictionary list def opening_scene(self): # Dominos calling Papa Johns, start_scene is order return self.next_scene(self.start_scene)
class Map(object): scenes = { 'last_day_on_earth': LastDayOnEarth(), 'death': Death(), 'exploring': Exploring(), 'escape': Escape(), 'deactivation': Deactivation() } def __init__(self, start_scene): self.start_scene = start_scene def next_scene(self, scene_name): return Map.scenes.get(scene_name) def opening_scene(self): return self.next_scene(self.start_scene)
class Map(object): scenes = {'center_alley' : S.CenterAlley(), 'center_street' : S.CenterStreet(), 'the_center' : S.TheCenter(), 'death' : Death() } # initializes to a starting scene def __init__(self, start_scene): self.start_scene = start_scene # gets the specified scene from the scenes dictionary list. def next_scene(self, scene_name): return Map.scenes.get(scene_name) # gets the first scene of the map from the dictionary list def opening_scene(self): return self.next_scene(self.start_scene)
class Engine(object): Rooms = { 'start': Start(), 'death': Death(), 'finished': Finished() } def __init__(self, current_room_name): self.current_room = self.Rooms.get(current_room_name) def play_game(self): next_room_name = 'None' while next_room_name == 'None': self.current_room.enter_room() next_room_name = self.current_room.exit_room() self.current_room = self.Rooms.get(next_room_name) next_room_name = self.current_room.info.get('next_room')
class Map(object): scenes = { 'cementery': Cementery(), 'corridor': Corridor(), 'death': Death(), 'maze': Maze(), 'tomb': Tomb(), 'finished': Finished(), } def __init__(self, start_scene): self.start_scene = start_scene def next_scene(self, scene_name): val = Map.scenes.get(scene_name) return val def opening_scene(self): return self.next_scene(self.start_scene)
class Map(object): scenes = { 'RiddleTown': S.RiddleTown(), 'highschool': S.Highschool(), 'fakefriends': S.Fakefriends(), 'rockpaperscissors': S.Rockpaperscissors(), 'death': Death() } # initializes to a starting scene def __init__(self, start_scene): self.start_scene = start_scene # gets the specified scene from the scenes dictionary list. def next_scene(self, scene_name): return self.scenes.get(scene_name) # gets the first scene of the map from the dictionary list def opening_scene(self): return self.next_scene(self.start_scene)
class Map(object): scenes = { 'central_corridor': CentralCorridor(), 'death': Death(), 'finished': Planet(), 'armory': Armory(), 'bridge': Bridge(), 'pod': EscapePod() } def __init__(self, start_scene): self.start_scene = start_scene def next_scene(self, scene_name): val = Map.scenes.get(scene_name) return val def opening_scene(self): return self.next_scene(self.start_scene)
class Map(object): scenes = { 'round_1': S.FatalFistFred(), 'round_2': S.SwordSwingingSteve(), 'round_3': S.PennyPuncherPerry(), 'round_4': S.MathIsHard(), 'death': Death() } # initializes to a starting scene def __init__(self, start_scene): self.start_scene = start_scene # gets the specified scene from the scenes dictionary list. def next_scene(self, scene_name): return Map.scenes.get(scene_name) # gets the first scene of the map from the dictionary list def opening_scene(self): return self.next_scene(self.start_scene)
class Map(object): scenes = { 'central_corridor': CentralCorridor(), 'laser_weapon_armory': LaserWeaponArmory(), 'the_bridge': TheBridge(), 'escape_pod': EscapePod(), 'death': Death(), 'finished': Finished(), } def __init__(self, start_scene): self.start_scene = start_scene def next_scene(self, scene_name): val = Map.scenes.get(scene_name) return val def opening_scene(self): return self.next_scene(self.start_scene)
class Map(object): scenes = { 'central_corridor': S.CentralCorridor(), 'laser_weapon_armory': S.LaserWeaponArmory(), 'the_bridge': S.TheBridge(), 'escape_pod': S.EscapePod(), 'death': Death() # raise ValueError ('todo') } # initializes to a starting scene def __init__(self, start_scene): self.start_scene = start_scene # gets the specified scene from the scenes dictionary list. def next_scene(self, scene_name): return Map.scenes.get(scene_name) # gets the first scene of the map from the dictionary list def opening_scene(self): return self.next_scene(self.start_scene)
class Map(object): scenes = { 'treehouse_jungle': S.TreehouseJungle(), 'crazy_beach': S.CrazyBeach(), 'park_bench': S.ParkBench(), 'bluff_lake': S.BluffLake(), 'death': Death() # raise ValueError ('todo') } # initializes to a starting scene def __init__(self, treehouse_jungle): self.start_scene = treehouse_jungle # gets the specified scene from the scenes dictionary list. def next_scene(self, crazy_beach): return Map.scenes.get(crazy_beach) # gets the first scene of the map from the dictionary list def opening_scene(self): return self.next_scene(self.start_scene)
class Map(object): scenes = { 'oweek-scene': S.oweek(), 'study space': S.studyingspace(), 'compsci-scene': S.compsci(), 'food-scene': S.food(), 'final-scene': S.finals(), 'death': Death.death() } # initializes to a starting scene def __init__(self, start_scene): self.start_scene = start_scene # gets the specified scene from the scenes dictionary list. def next_scene(self, scene_name): return Map.scenes.get(scene_name) # gets the first scene of the map from the dictionary list def opening_scene(self): return self.next_scene(self.start_scene)
class PlotMaps(object): # contains all plots of adventure game Plots = { 'cave_mouth': CaveMouth(), 'the_woods': TheWoods(), 'river_crossing': RiverCrossing(), 'kings_hideout': KingsHideout(), 'princess_blood': PrincessBlood(), 'secret_weapon': SecretWeapon(), 'final_chapter': FinalChapter(), 'death': Death() } def __init__(self, start_plot): self.start_plot = start_plot def next_plot(self, plot_name): # get next plot val = PlotMaps.Plots.get(plot_name) return val def beginning(self): # display current plot return self.next_plot(self.start_plot)
class Map(object): scenes = { "round_one": S.RoundOne(), 'round_five': S.RoundFive(), 'double_octos': S.DoubleOctos(), 'semis': S.Semis(), 'finals': S.Finals(), 'death': Death() # raise ValueError ('todo') } # initializes to a starting scene def __init__(self, start_scene): self.start_scene = start_scene # gets the specified scene from the scenes dictionary list. def next_scene(self, scene_name): return Map.scenes.get(scene_name) # gets the first scene of the map from the dictionary list def opening_scene(self): return self.next_scene(self.start_scene)
class Map(object): scenes = { 'central_corridor': S.CentralCorridor(), 'laser_weapon_armory': S.LaserWeaponArmory(), 'the_temple': S.Temple(), 'the_spaceship': S.SpaceShip(), 'the_lab': S.Lab(), 'the_exit': S.Exit(), 'death': Death() } # initializes to a starting scene def __init__(self, start_scene): self.start_scene = start_scene # gets the specified scene from the scenes dictionary list. def next_scene(self, scene_name): return Map.scenes.get(scene_name) # gets the first scene of the map from the dictionary list def opening_scene(self): return self.next_scene(self.start_scene)
class Map(object): scenes = { 'difficulty': S.Difficulty(), 'downtown_chicago': S.DowntownChicago(), 'red_line': S.RedLine(), 'train_car': S.TrainCar(), 'cross_walk': S.CrossWalk(), 'broke_bus': S.BrokeBus(), 'death': Death() } # initializes to a starting scene def __init__(self, start_scene): self.start_scene = start_scene # gets the specified scene from the scenes dictionary list. def next_scene(self, scene_name): return Map.scenes.get(scene_name) # gets the first scene of the map from the dictionary list def opening_scene(self): return self.next_scene(self.start_scene)
class Sums(object): # This is just a simple maths question game nothing special def __init__(self, more): self.death = Death("You can't do simple math???") self.names = more self.list = {'1':"15 + 10 * 6 = ", '2':"22 + 50 = "} self.timed = Timed(self.names) def second(self): os.system('clear') sleep(0.5) print "\033[34m%r\033[0m So you got past that last door" % self.names sleep(0.5) print "This seams to be a math challange are you ready" sleep(0.5) print "there are two envelope in front of you numbered \033[1;31m'1'\033[0m and \033[1;31m'2'\033[0m" sleep(0.5) print "Pick one of these envelope." sleep(0.5) self.picker = raw_input("'1' or '2' ") print "%r" % self.list[self.picker] answer = raw_input("??? ") # For some reason i can't get it to just acept the right answer, it will give a positive if i enter 150 or 72 while answer != "150" and answer != "72": print "Try again" answer = raw_input("??? ") if answer == "150": os.system('clear') print "right on, you run thought the open door to the next room." return self.timed.test1() elif answer == "72": os.system('clear') print "right on, you run thought the open door to the next room." return self.timed.test1() else: return self.death.dead() exit()
def __init__(self, more): self.names = more self.gold = Gold(self.names) self.death = Death("You forever burn in hell.") self.test1
class Lock(object): # Setting your name, death and the first 2 numbers for the first puzzle def __init__(self, more): self.names = more self.death = Death("Looks like the lock died, You curl up in a ball and await death.") self.first_two = "[%r:%r: ]" % (random.randint(1,10), random.randint(1,10)) self.sums = Sums(self.names) def guess(self): os.system('clear') sleep(0.5) print''' ooooo .oooooo. .oooooo. ooooo .oooooo. `888' d8P' `Y8b d8P' `Y8b `888' d8P' `Y8b 888 888 888 888 888 888 888 888 888 888 888 888 888 888 888 888 ooooo 888 888 888 o `88b d88' `88. .88' 888 `88b ooo o888ooooood8 `Y8bood8P' `Y8bood8P' o888o `Y8bood8P' ooooooooo. .oooooo. .oooooo. ooo ooooo .oooooo..o `888 `Y88. d8P' `Y8b d8P' `Y8b `88. .888' d8P' `Y8 888 .d88' 888 888 888 888 888b d'888 Y88bo. 888ooo88P' 888 888 888 888 8 Y88. .P 888 `"Y8888o. 888`88b. 888 888 888 888 8 `888' 888 `"Y88b 888 `88b. `88b d88' `88b d88' 8 Y 888 oo .d8P o888o o888o `Y8bood8P' `Y8bood8P' o8o o888o 8""88888P' ''' sleep(0.5) print "\033[034m%r\033[0m You enter a room with nothing in it bar a locked door with a keypad" % self.names sleep(0.5) print "There are 3 numbers you must guess to progress" sleep(0.5) print "Wait a minuite there are two numbers already keyed in so you only need to guess the final number" sleep(0.5) print "Here are the first two numbers \033[1;31m%r\033[0m" % self.first_two sleep(0.5) print "You know need to guess the final number." sleep(0.5) print "remember it has to be between \033[1;31m0\033[0m and \033[1;31m9\033[0m." sleep(0.5) print "You only got 6 tryes." sleep(0.5) last_one = "%r" % random.randint(0,9) print last_one guesses = 0 guess = raw_input("> ") # Uses a if statment but then goes into a while statment so that the first guess is recorded but you can still get it right first go if guess != last_one: guesses += 1 print"Guess again you have had %r guess" % guesses while guess != last_one and guesses < 6: guesses += 1 guess = raw_input("> ") print "Guess again you have guessed %r times." % guesses if last_one == guess: print "You done it, quickly run on to the next room." return self.sums.second() else: return self.death.dead() exit() else: print "You done it." self.sums.second()
def __init__(self, more): self.death = Death("You can't do simple math???") self.names = more self.list = {'1':"15 + 10 * 6 = ", '2':"22 + 50 = "} self.timed = Timed(self.names)
def __init__(self, more): self.names = more self.death = Death("Looks like the lock died, You curl up in a ball and await death.") self.first_two = "[%r:%r: ]" % (random.randint(1,10), random.randint(1,10)) self.sums = Sums(self.names)