Пример #1
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = 'Underground'
        # current level
        TW,TH = 32,32

        # load tile set
        g.tga_load_tiles(os.path.join("textures",  "tiles5.png"), (TW,TH), self.tdata)
        g.tga_load_level(os.path.join("levels",  "level24.tga"), 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)

        self.doctor = Character("monster3a.png", "monster3a.png", self.g, 'doctor')
        self.doctor.pos((25, 20)) # 25, 20

        self.assistant = Character("assistant.png","faceassistant.png", g)
        self.assistant.pos((33, 27))
        self.assistant.direction = 1
        self.assistant.feeling  = 'coma'

        self.nurse = None # will get set by character.py later on

        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
        self.g.player.hidden = 0
        self.movie = 0
        
        # battled and destoryed the doctor
        if  'scene13' in g.saveData:
            self.doctor.health = 0
            self.nurse = Character("monster4.png", "facenurse.png", self.g, 'nurse')
            self.nurse.pos((29, 27))
            if not 'scene14' in g.saveData:
                self.nurse.feeling = 'dead'
Пример #2
0
    def __init__(self, g, player_new, dimentions, p=0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = "Airport"
        # current level
        TW, TH = 32, 32

        # load tile set
        g.tga_load_tiles(os.path.join("textures", "tiles5.png"), (TW, TH), self.tdata)
        g.tga_load_level(os.path.join("levels", "level29.tga"), 1)
        g.bounds = pygame.Rect(TW, TH, (len(g.tlayer[0]) - 2) * TW, (len(g.tlayer) - 2) * TH)
        g.code_events(self.edata)

        self.g.player.hidden = 0
        self.pan_camera(None)

        self.doctor = Character("monster3a.png", "monster3a.png", self.g, "doctor")
        self.doctor.pos((25, 20))  # 25, 20
        self.doctor.health = 0
        self.doctor.dead = 1

        self.movie = 0
        self.assistant = Character("assistant.png", "faceassistant.png", g)
        self.assistant.pos((33, 27))
        self.assistant.feeling = "coma"
        self.nurse = Character("monster4.png", "facenurse.png", self.g, "nurse")
        self.nurse.pos((29, 27))
        self.nurse.direction = 0
        if not "scene14" in g.saveData:
            self.nurse.feeling = "dead"
        g.run_codes(self.cdata, (0, 0, g.dimentions[0], g.dimentions[1]))
Пример #3
0
    def __init__(self, g, player_new, dimentions, p=0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = "Clock Tower"

        # current level
        currentLevel = os.path.join("levels", "level4.tga")

        TW, TH = 32, 32

        # load tile set
        tileTexture = os.path.join("textures", "tiles1.png")
        g.tga_load_tiles(tileTexture, (TW, TH), self.tdata)
        g.tga_load_level(currentLevel, 1)
        g.bounds = pygame.Rect(TW, TH, (len(g.tlayer[0]) - 2) * TW, (len(g.tlayer) - 2) * TH)
        g.code_events(self.edata)

        self.assistant = Character("assistant.png", "faceassistant.png", g)
        self.assistant.pos((3, 24))
        self.assistant.direction = 0

        g.run_codes(self.cdata, (0, 0, g.dimentions[0], g.dimentions[1]))
        if "scene3" in g.saveData:
            self.dialog = 4
            self.g.sprites.remove(self.assistant)
Пример #4
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = "Tracks"

        # current level
        currentLevel = os.path.join("levels",  "level5.tga")

        TW,TH = 32,32

        # load tile set
        tileTexture = os.path.join("textures",  "tiles1.png")
        g.tga_load_tiles(tileTexture, (TW,TH), self.tdata)
        g.tga_load_level(currentLevel, 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)

        self.assistant = Character("assistant.png","faceassistant.png", g)
        self.assistant.pos((5, 10))
        self.assistant.direction = 0
        if 'scene5' in g.saveData:
            self.assistant.hidden = 1
        
        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
        self.initBack('bg0.png', 170)
Пример #5
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = 'Flooded Lab'
        # current level
        TW,TH = 32,32

        # load tile set
        g.tga_load_tiles(os.path.join("textures",  "tiles6.png"), (TW,TH), self.tdata)
        g.tga_load_level(os.path.join("levels",  "level33.tga"), 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)

        self.stygian = Character('stygian.png', 'facestygian.png', g)
        self.stygian.pos((8, 9))
        self.stygian.direction = 1
        self.boat = Character('boat.png', 'facestygian.png', g, 'boat')
        self.boat.pos((9, 11))
        
        self.professor = Character("professor.png","faceprofessor.tga", g)
        self.professor.pos((5, 9))
        self.professor.direction = 0
        
        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
        self.initBack('bg0.png', 140)
Пример #6
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = 'Water of Leith'

        # current level
        currentLevel = os.path.join("levels",  "level3.tga")

        TW,TH = 32,32

        # load tile set
        tileTexture = os.path.join("textures",  "tiles0.png")
        g.tga_load_tiles(tileTexture, (TW,TH), self.tdata)
        g.tga_load_level(currentLevel, 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)

        self.assistant = Character("assistant.png","faceassistant.png", g)
        self.assistant.pos((3, 10))
        self.assistant.direction = 0
        g.intermission = 1
        
        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))

        # already done the cut scene
        if 'scene2' in g.saveData:
            self.dialog = 5
        if 'scene4' in g.saveData:
            self.g.sprites.remove(self.assistant)
        self.initBack('bg0.png', 180)
Пример #7
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = 'Jail'
        # current level
        TW,TH = 32,32

        # load tile set
        g.tga_load_tiles(os.path.join("textures",  "tiles5.png"), (TW,TH), self.tdata)
        g.tga_load_level(os.path.join("levels",  "level19.tga"), 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)

        # and an odd object called flutter box. flutter shutter (37, 13) 
        self.terrorist = Character("terrorist.png","faceterrorist.tga", g)
        self.terrorist.pos((3, 20))
        self.terrorist.direction = 0
        self.terrorist.faceup = 1

        self.flutterbox = Inventory(g, 'flutterbox')
        self.flutterbox.pos((37, 13))
        self.flutterswitch = Inventory(g, 'flutterswitch')
        self.flutterswitch.pos((37, 20))

        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
Пример #8
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = 'Office Complex Top'
        # current level
        TW,TH = 32,32

        # load tile set
        g.tga_load_tiles(os.path.join("textures",  "tiles6.png"), (TW,TH), self.tdata)
        g.tga_load_level(os.path.join("levels",  "level31.tga"), 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)
        self.initBack('bg1.png', 730)

        self.backuptape = Inventory(g, 'tape', (37, 22))
        self.backuptape.pos((37, 22))
        self.backup = Character('backup.png', 'facebackup.png', g, 'backup')
        self.backup.pos((28, 25))
        self.backup.direction = 0
        if 'scene21' in g.saveData:
            self.backup.hidden = 1
        # coming back and saying high to the guy.
        if 'scene20' in g.saveData and not 'scene21' in g.saveData:
            del g.saveData['scene20']

        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
        self.coins = 0
Пример #9
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = "Tree House"

        # current level
        currentLevel = os.path.join("levels",  "level7.tga")

        TW,TH = 32,32

        # load tile set
        tileTexture = os.path.join("textures",  "tiles2.png")
        g.tga_load_tiles(tileTexture, (TW,TH), self.tdata)
        g.tga_load_level(currentLevel, 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)

        self.fox = Character("fox.png","facefox.tga", g, 'fox')
        self.fox.pos((3, 9))
        self.fox.direction = 0
        self.fox.hidden = 1

        self.assistant = Character("assistant.png","faceassistant.png", g)
        self.assistant.pos((9, 10))
        self.assistant.direction = 0
        
        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
        self.g.player.direction = 1
        g.intermission = 1
        if 'scene5' in g.saveData:
            self.assistant.hidden = 1
            self.fox.hidden = 1
            self.dialog = 10
Пример #10
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new,dimentions)
        self.prevlevel = p

        self.title = 'Gardies Cloning faclities'
        # current level
        currentLevel = os.path.join("levels",  "level0.tga")

        TW,TH = 32,32

        # an ambient sound plays
        ambientSound = os.path.join("ambient",  "amb1.ogg")
        pygame.mixer.music.load(ambientSound)

        # load tile set
        tileTexture = os.path.join("textures",  "tiles0.png")
        g.tga_load_tiles(tileTexture, (TW,TH), self.tdata)
        g.tga_load_level(currentLevel, 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
        g.code_events(self.edata)

        # fade in and display a quick waking up animation
        if 'scene_start' in g.saveData:
            self.timer = 255
        else:
            g.saveData['scene_start'] = 1
            g.intermission = 1
Пример #11
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new,dimentions)
        self.prevlevel = p
        self.title = 'Engineers Lab'

        # current level
        currentLevel = os.path.join("levels",  "level2.tga")

        TW,TH = 32,32

        # load tile set
        tileTexture = os.path.join("textures",  "tiles0.png")
        g.tga_load_tiles(tileTexture, (TW,TH), self.tdata)
        g.tga_load_level(currentLevel, 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)

        self.microwave = Inventory(g, 'microwave')
        self.microwave.pos((6, 9))

        self.professor = Character("professor.png","faceprofessor.tga", g)
        self.professor.pos((6, 9))
        self.professor.direction = 0

        self.assistant = Character("assistant.png","faceassistant.png", g)
        self.assistant.pos((12, 9))
        self.assistant.direction = 1
        
        g.intermission = 1

        # already done the cut scene
        if 'scene1' in g.saveData:
            g.intermission = 0
            self.professor.pos((11, 9))
            self.dialog = 9
            self.g.sprites.remove(self.assistant)

        # if you've put the transmitter in
        if 'scene3' in g.saveData:
            self.assistant = Character("assistant.png","faceassistant.png", g)
            self.assistant.pos((13, 9))
            self.professor.pos((8, 9))
            self.assistant.direction = 1
            self.dialog = 10
            g.intermission = 1
        
        # already had the talk after putting in the transmitter
        if 'scene4' in g.saveData:
            self.dialog = 19
            g.intermission = 0
            self.g.sprites.remove(self.assistant)

        if 'scene5' in g.saveData:
            self.dialog = 20
            self.professor.pos((11,9))
            self.professor.faceup = 1

        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
Пример #12
0
 def __init__(self, g, player_new, dimentions, p = 0):
     LevelBase.__init__(self, g, player_new, dimentions)
     self.prevlevel = p
     self.title = 'Jail - Airport Shortcut'
     # current level
     TW,TH = 32,32
     # load tile set
     g.tga_load_tiles(os.path.join("textures",  "tiles5.png"), (TW,TH), self.tdata)
     g.tga_load_level(os.path.join("levels",  "level35.tga"), 1)
     g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
     g.code_events(self.edata)
     g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
Пример #13
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = 'Office Complex Top'
        # current level
        TW,TH = 32,32

        # load tile set
        g.tga_load_tiles(os.path.join("textures",  "tiles6.png"), (TW,TH), self.tdata)
        g.tga_load_level(os.path.join("levels",  "level30.tga"), 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)
        self.initBack('bg1.png', 230)

        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
Пример #14
0
    def __init__(self, g, player_new, dimentions, p=0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = "Jail"
        # current level
        TW, TH = 32, 32

        # load tile set
        g.tga_load_tiles(os.path.join("textures", "tiles5.png"), (TW, TH), self.tdata)
        g.tga_load_level(os.path.join("levels", "level17.tga"), 1)
        g.bounds = pygame.Rect(TW, TH, (len(g.tlayer[0]) - 2) * TW, (len(g.tlayer) - 2) * TH)
        g.code_events(self.edata)

        self.vats = Inventory(g, "clonevat")
        self.vats.pos((18, 13))
        g.run_codes(self.cdata, (0, 0, g.dimentions[0], g.dimentions[1]))
Пример #15
0
    def level_loop(self):
        g = self.g
        LevelBase.level_loop(self)
        
        # when the player investigates something
        if g.player.pos == (3,10) or g.player.pos == (4,10):
            if g.event:
                self.dialog = 1
            if self.dialog == 1:
                str = "\"Stem Scaffolding Construction Device\""
                str += "\nGARD01"
                self.info_box(str)
        if g.player.pos == (5,10):
            if g.event:
                self.dialog = 2
            if self.dialog == 2:
                str = "$> patch --binary template.bsf subject24.bsf > /dev/tty2"
                str += "\nis written on console"
                self.info_box(str)

        if self.oldPos != g.player.pos:
            # clear dialog box
            self.dialog = 0
            
        # remmber last pos so I can remove old dialoge boxes
        self.oldPos = g.player.pos

        self.timer += 1
        # fade out of black
        if self.timer < 255:
            if self.timer < 64:
                alpha = self.timer * 4
                self.g.screen.fill((alpha,alpha,alpha), None, BLEND_MULT)
            if self.timer < 50:
                self.g.player.animation = 1
            elif self.timer < 118:
                self.g.player.animation = 2
            elif self.timer < 135:
                self.g.player.animation = 1
            elif self.timer < 140:
                self.g.player.animation = 2
            elif self.timer < 145:
                self.g.player.animation = 3
            elif self.timer < 156:
                self.g.player.animation = 0
                g.intermission = 0
Пример #16
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = 'Office'

        # current level
        currentLevel = os.path.join("levels",  "level12.tga")

        TW,TH = 32,32

        # load tile set
        tileTexture = os.path.join("textures",  "tiles4.png")
        g.tga_load_tiles(tileTexture, (TW,TH), self.tdata)
        g.tga_load_level(currentLevel, 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)
        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
Пример #17
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = 'Underground'
        # current level
        TW,TH = 32,32

        # load tile set
        g.tga_load_tiles(os.path.join("textures",  "tiles5.png"), (TW,TH), self.tdata)
        g.tga_load_level(os.path.join("levels",  "level22.tga"), 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)
        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
        self.g.player.hidden = 0
        
        # so you can get back
        if self.prevlevel == 23:
            self.switches[0].pull_switch()
Пример #18
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = 'Airport'
        # current level
        TW,TH = 32,32

        # load tile set
        g.tga_load_tiles(os.path.join("textures",  "tiles6.png"), (TW,TH), self.tdata)
        g.tga_load_level(os.path.join("levels",  "level28.tga"), 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)

        self.vats = Inventory(g, 'plane')
        self.vats.pos((18, 9))

        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
        self.g.player.hidden = 0
        self.pan_camera(None)
        self.initBack('bg3.png', 190, 512)
        self.effect = GameEffect(g,'wind')
        pygame.mixer.music.load(os.path.join("ambient",  "amb15.ogg"))
        pygame.mixer.music.play(40000)
        
        self.fox = Character("fox.png","facefox.tga", g, 'fox')
        self.fox.pos((31, 15))
        self.fox.direction = 0
        self.fox.health = 40
        self.fox.healthmax = 40

        self.director = Character("director.png","facedirector.png", g, 'director')
        self.director.pos((36, 16))
        self.director.direction = 1
        
        if 'scene16' in g.saveData:
            self.fox.hidden = 1
        if 'scene17' in g.saveData:
            self.fox.feeling = 'dead'
            self.director.hidden = 1
        # plane is gone if you got imas backup tape
        if 'i_tape' in g.saveData:
            self.vats.removeself()
        self.invbox = 0
Пример #19
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = 'Airport'
        # current level
        TW,TH = 32,32

        # load tile set
        g.tga_load_tiles(os.path.join("textures",  "tiles6.png"), (TW,TH), self.tdata)
        g.tga_load_level(os.path.join("levels",  "level25.tga"), 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)
        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
        self.g.player.hidden = 0
        self.pan_camera(None)
        self.initBack('bg3.png', 190, 512)
        self.effect = GameEffect(g,'wind')
        pygame.mixer.music.load(os.path.join("ambient",  "amb15.ogg"))
        pygame.mixer.music.play(40000)
Пример #20
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = 'Office'

        # current level
        currentLevel = os.path.join("levels",  "level13.tga")

        TW,TH = 32,32

        # load tile set
        tileTexture = os.path.join("textures",  "tiles4.png")
        g.tga_load_tiles(tileTexture, (TW,TH), self.tdata)
        g.tga_load_level(currentLevel, 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)
        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))

        # intermission!
        self.fox = Character("fox.png","facefox.tga", g, 'fox')
        self.fox.pos((27, 13))
        self.fox.direction = 0
        self.fox.hidden = 1

        self.assistant = Character("assistant.png","faceassistant.png", g)
        self.assistant.pos((28, 9))
        self.assistant.direction = 0
        self.assistant.feeling = 'pulled'
        self.assistant.hidden = 1

        self.director = Character("director.png","facedirector.png", g, 'director')
        self.director.pos((32, 14))
        self.director.direction = 1
        self.director.feeling = 'sit'

        if 'scene18' in g.saveData:
            self.director.hidden = 1
            self.dialog = 15
            g.intermission = 0
            self.switches[0].open = 1
Пример #21
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = 'Jail'

        # current level
        TW,TH = 32,32

        # load tile set
        tileTexture = os.path.join("textures",  "tiles5.png")
        g.tga_load_tiles(tileTexture, (TW,TH), self.tdata)
        currentLevel = os.path.join("levels",  "level14.tga")
        g.tga_load_level(currentLevel, 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)

        self.robot = Character("robot0.png","facerobot.tga", g,'robot')
        self.robot.pos((13, 20))
        self.robot.direction = 0
        
        #(2, 3) 'i_arms' in g.saveData
        self.arms = Inventory(g, 'arms')
        self.arms.pos((2,3))

        # if you've given her arms
        if 'scene7' in g.saveData:
            self.dialog = 6
            self.robot.feeling = 'arms'

        # if you read the newspaper, she fights you to get to the top
        self.newspaper = 0
        if 'scene17' in g.saveData:
            self.newspaper = Inventory(g, "newspaper")
            self.newspaper.pos((6, 20))

        if 'scene19' in g.saveData:
            self.robot.feeling = 'dead'
            self.robot.hidden = 1

        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
Пример #22
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = 'Octagon'

        # current level
        currentLevel = os.path.join("levels",  "level10.tga")
        TW,TH = 32,32

        # load tile set
        tileTexture = os.path.join("textures",  "tiles4.png")
        g.tga_load_tiles(tileTexture, (TW,TH), self.tdata)
        g.tga_load_level(currentLevel, 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)
        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
        
        self.initBack('bg1.png', 180)
        
        if 'scene15' in g.saveData:
            self.switches[0].open = 1
            self.switches[1].open = 1
Пример #23
0
    def __init__(self, g, player_new, dimentions, p = 0):
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = 'Elevator'
        # current level
        TW,TH = 32,32

        # load tile set
        g.tga_load_tiles(os.path.join("textures",  "tiles5.png"), (TW,TH), self.tdata)
        g.tga_load_level(os.path.join("levels",  "level21.tga"), 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)

        #see two dead fish. Symbolisim
        self.vats = Inventory(g, 'fish0')
        self.vats.pos((19, 19))
        self.vats = Inventory(g, 'fish1')
        self.vats.pos((28, 19))

        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))
        self.initBack('bg2.png', 680)
        self.g.player.hidden = 0
Пример #24
0
    def __init__(self, g, player_new, dimentions, p = 0):
        self.monsters = []
        LevelBase.__init__(self, g, player_new, dimentions)
        self.prevlevel = p
        self.title = 'Jail'
        # current level
        TW,TH = 32,32

        # load tile set
        tileTexture = os.path.join("textures",  "tiles5.png")
        g.tga_load_tiles(tileTexture, (TW,TH), self.tdata)
        currentLevel = os.path.join("levels",  "level15.tga")
        g.tga_load_level(currentLevel, 1)
        g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
        g.code_events(self.edata)

        self.mushroom = Character("mushroom.png","faceassistant.png", g, 'mushroom')
        self.mushroom.pos((5, 20))

        g.run_codes(self.cdata,(0,0,g.dimentions[0],g.dimentions[1]))

        if 'scene9' in g.saveData:
            self.mushroom.dead = 1
Пример #25
0
    def level_loop(self):
        g = self.g
        LevelBase.level_loop(self)

        # when the player investigates something
        if g.player.pos == (6, 9):
            if g.event:
                self.dialog = 1
            if self.dialog == 1:
                str = "Gardies Research Facility"
                self.info_box(str)
        if g.player.pos == (34, 9):
            if g.event:
                self.dialog = 1
            if self.dialog == 1:
                str = "Centre For Innovation"
                self.info_box(str)

        if self.oldPos != g.player.pos:
            # clear dialog box
            self.dialog = 0

        # remmber last pos so I can remove old dialoge boxes
        self.oldPos = g.player.pos
Пример #26
0
 def leave(self):
     LevelBase.leave(self)