예제 #1
0
    def setup(self):
        super(Pyramid1000AD, self).setup()

        self.door.destination = self.time_period.areas['default'].pyramid_door
        self.main_layer.add(self.door)
        self.door.move_to(self.DOOR_X, self.ground_top - self.door.rect.height)

        x = self.topleft_platform.rect.left
        y = self.topleft_platform.rect.top

        flip_count = 0
        flip = False

        for i in range(8):
            step = TiledSprite(self.wall_name, 4, 1)
            self.main_layer.add(step)

            if flip:
                x += step.rect.width
            else:
                x -= step.rect.width

            flip_count += 1

            if flip_count == 3:
                flip_count = 0
                flip = not flip

            y += 2 * step.rect.height
            step.move_to(x, y)
예제 #2
0
    def setup(self):
        tiles_x = self.size[0] / 32
        ground = TiledSprite('ground', tiles_x, 1)
        self.main_layer.add(ground)
        ground.move_to(0, self.size[1] - ground.rect.height)

        hills = Sprite('600ad/hills_1')
        self.bg_layer.add(hills)
        hills.move_to(0, ground.rect.top - hills.rect.height)

        mountain = Mountain()
        mountain.add_to(self)
        mountain.move_to(1300, ground.rect.top - mountain.rect.height)

        # Mountain platforms
        platform = Sprite('600ad/platform')
        self.main_layer.add(platform)
        platform.move_to(1740,
                         mountain.rect.bottom - platform.rect.height - 10)

        platform = Sprite('600ad/platform')
        self.main_layer.add(platform)
        platform.move_to(1990,
                         mountain.rect.bottom - platform.rect.height - 100)

        platform = Sprite('600ad/platform')
        self.main_layer.add(platform)
        platform.move_to(2240,
                         mountain.rect.bottom - platform.rect.height - 180)

        platform = Sprite('600ad/platform')
        self.main_layer.add(platform)
        platform.move_to(1990,
                         mountain.rect.bottom - platform.rect.height - 260)

        platform = Sprite('600ad/platform')
        self.main_layer.add(platform)
        platform.move_to(2240,
                         mountain.rect.bottom - platform.rect.height - 340)

        platform = Sprite('600ad/platform')
        self.main_layer.add(platform)
        platform.move_to(1990,
                         mountain.rect.bottom - platform.rect.height - 420)

        platform = Sprite('600ad/platform')
        self.main_layer.add(platform)
        platform.move_to(2240,
                         mountain.rect.bottom - platform.rect.height - 500)
예제 #3
0
    def setup(self):
        tiles_x = self.size[0] / 32
        ground = TiledSprite("ground", tiles_x, 1)
        self.main_layer.add(ground)
        ground.move_to(0, self.size[1] - ground.rect.height)

        hills = Sprite("600ad/hills_1")
        self.bg_layer.add(hills)
        hills.move_to(0, ground.rect.top - hills.rect.height)

        mountain = Mountain()
        mountain.add_to(self)
        mountain.move_to(1300, ground.rect.top - mountain.rect.height)

        # Mountain platforms
        platform = Sprite("600ad/platform")
        self.main_layer.add(platform)
        platform.move_to(1740, mountain.rect.bottom - platform.rect.height - 10)

        platform = Sprite("600ad/platform")
        self.main_layer.add(platform)
        platform.move_to(1990, mountain.rect.bottom - platform.rect.height - 100)

        platform = Sprite("600ad/platform")
        self.main_layer.add(platform)
        platform.move_to(2240, mountain.rect.bottom - platform.rect.height - 180)

        platform = Sprite("600ad/platform")
        self.main_layer.add(platform)
        platform.move_to(1990, mountain.rect.bottom - platform.rect.height - 260)

        platform = Sprite("600ad/platform")
        self.main_layer.add(platform)
        platform.move_to(2240, mountain.rect.bottom - platform.rect.height - 340)

        platform = Sprite("600ad/platform")
        self.main_layer.add(platform)
        platform.move_to(1990, mountain.rect.bottom - platform.rect.height - 420)

        platform = Sprite("600ad/platform")
        self.main_layer.add(platform)
        platform.move_to(2240, mountain.rect.bottom - platform.rect.height - 500)
예제 #4
0
    def setup(self):
        level_width, level_height = self.size

        tiles_x = self.size[0] / 144
        ground = TiledSprite('1000ad/ground', tiles_x, 1)
        self.main_layer.add(ground)
        ground.move_to(0, level_height - ground.rect.height)

        cactus = Cactus()
        self.main_layer.add(cactus)
        cactus.move_to(100, ground.rect.top - cactus.rect.height)

        pyramid = Sprite('1000ad/pyramid')
        self.bg_layer.add(pyramid)
        pyramid.move_to(922, ground.rect.top - pyramid.rect.height)

        cactus = Cactus()
        self.main_layer.add(cactus)
        cactus.move_to(pyramid.rect.left + 100,
                       ground.rect.top - cactus.rect.height)

        cactus = Cactus()
        self.main_layer.add(cactus)
        cactus.move_to(2600, ground.rect.top - cactus.rect.height)

        self.pyramid_door.destination = self.time_period.areas['pyramid'].door
        self.main_layer.add(self.pyramid_door)
        self.pyramid_door.move_to(
            pyramid.rect.left + 621,
            pyramid.rect.bottom - self.pyramid_door.rect.height)

        snake = Snake()
        self.main_layer.add(snake)
        snake.move_to(pyramid.rect.left - snake.rect.width,
                      ground.rect.top - snake.rect.height)

        # Artifact
        self.level.add_artifact(self, cactus.rect.right + 100, ground.rect.top)
예제 #5
0
    def setup(self):
        level_width, level_height = self.size

        lava_name = '65000000bc/lava_pool'
        tiles_x = level_width / load_image(lava_name).get_width()
        lava = TiledSprite('65000000bc/lava_pool', tiles_x, 1)
        lava.lethal = True
        self.main_layer.add(lava)
        lava.move_to(0, level_height - lava.rect.height)

        cliff = Sprite('40000000ad/cliff_left')
        cliff.use_pixel_collisions = True
        self.main_layer.add(cliff)
        cliff.move_to(0, level_height - cliff.rect.height)

        self.main_layer.add(self.bluebox)
        self.bluebox.move_to(60, cliff.rect.top - self.bluebox.rect.height)
        self.bluebox.destination = self.time_period.areas['bluebox'].door

        cliff = Sprite('40000000ad/cliff_middle')
        cliff.use_pixel_collisions = True
        self.main_layer.add(cliff)
        cliff.move_to(1720, level_height - cliff.rect.height)
예제 #6
0
    def setup(self):
        level_width, level_height = self.size

        ground = TiledSprite('12000bc/ground', 3, 1)
        self.main_layer.add(ground)
        ground.move_to(0, level_height - ground.rect.height)
        x = ground.rect.right + 800

        tiles_x = (self.size[0] - x) / 144
        ground = TiledSprite('12000bc/ground', tiles_x, 1)
        self.main_layer.add(ground)
        ground.move_to(x, level_height - ground.rect.height)

        ice_hill = Sprite('12000bc/ice_hill_left')
        self.main_layer.add(ice_hill)
        ice_hill.use_pixel_collisions = True
        ice_hill.move_to(0, ground.rect.top - ice_hill.rect.height + 18)

        ice_hill = Sprite('12000bc/ice_hill_right')
        self.main_layer.add(ice_hill)
        ice_hill.use_pixel_collisions = True
        ice_hill.move_to(level_width - ice_hill.rect.width,
                         ground.rect.top - ice_hill.rect.height + 18)

        hill_bg = Sprite('12000bc/hill_bg')
        self.bg_layer.add(hill_bg)
        hill_bg.move_to(ice_hill.rect.right,
                        ground.rect.top - hill_bg.rect.height)

        hill_bg = Sprite('12000bc/hill_bg')
        self.bg_layer.add(hill_bg)
        hill_bg.move_to(ground.rect.left + 600,
                        ground.rect.top - hill_bg.rect.height)

        hill_bg = Sprite('12000bc/hill_bg')
        self.bg_layer.add(hill_bg)
        hill_bg.move_to(ground.rect.left + 2000,
                        ground.rect.top - hill_bg.rect.height)

        self.ice_boulder = IceBoulder()
        self.main_layer.add(self.ice_boulder)
        self.ice_boulder.move_to(
            2315, ground.rect.top - self.ice_boulder.rect.height)
예제 #7
0
    def setup(self):
        level_width, level_height = self.size

        # Ground
        tiles_x = self.size[0] / 32
        ground = TiledSprite("ground", tiles_x, 1)
        self.main_layer.add(ground)
        ground.move_to(0, self.size[1] - ground.rect.height)

        building_rect = self.BUILDING_RECT.move(0, ground.rect.top - self.BUILDING_RECT.height)

        # Building background
        building_bg = Box(*building_rect.size)
        self.bg_layer.add(building_bg)
        building_bg.move_to(*building_rect.topleft)

        # First floor
        floor1 = Box(building_rect.width, self.GROUND_HEIGHT, self.FLOOR_COLOR)
        self.main_layer.add(floor1)
        floor1.move_to(building_rect.left, ground.rect.top)

        # Second floor
        floor2 = Box(building_rect.width, self.GROUND_HEIGHT, self.FLOOR_COLOR)
        self.main_layer.add(floor2)
        floor2.move_to(building_rect.left, building_rect.top + (building_rect.height - floor2.rect.height) / 2)

        # Left wall of building
        box = Box(self.WALL_WIDTH, building_rect.height, self.WALL_COLOR)
        self.main_layer.add(box)
        box.move_to(building_rect.left, building_rect.top)

        # Right wall of the building
        right_wall = Box(self.WALL_WIDTH, building_rect.height, self.WALL_COLOR)
        self.main_layer.add(right_wall)
        right_wall.move_to(building_rect.right - self.WALL_WIDTH, building_rect.top)

        # Ceiling
        box = Box(building_rect.width, self.GROUND_HEIGHT)
        self.main_layer.add(box)
        box.move_to(building_rect.left, building_rect.top)

        # Top elevator
        elevator1 = Elevator()
        self.main_layer.add(elevator1)
        elevator1.move_to(building_rect.left + 100, building_rect.top - elevator1.rect.height)

        # Bottom elevator
        elevator2 = Elevator()
        self.main_layer.add(elevator2)
        elevator2.move_to(elevator1.rect.left, floor2.rect.top - elevator2.rect.height)

        # Link up the elevators
        elevator1.destination = elevator2
        elevator2.destination = elevator1

        # Dynamite
        self.main_layer.add(self.level.dynamite)
        self.level.dynamite.move_to(
            right_wall.rect.left - self.level.dynamite.rect.width - 20,
            floor2.rect.top - self.level.dynamite.rect.height,
        )
        # self.level.dynamite.move_to(
        #    200, ground.rect.top - self.level.dynamite.rect.height)

        # Mountain
        mountain = Mountain()
        mountain.add_to(self)
        mountain.move_to(1300, ground.rect.top - mountain.rect.height)

        platform = Sprite("1999ad/lavamatics_platform")
        self.main_layer.add(platform)
        platform.move_to(1841, mountain.rect.bottom - platform.rect.height - 500)

        platform = Sprite("1999ad/l_tube")
        self.main_layer.add(platform)
        platform.move_to(2140, mountain.rect.bottom - platform.rect.height - 450)
예제 #8
0
    def setup(self):
        self.exploding = False
        self.exploded = False

        ground = TiledSprite("ground", self.size[0] / 32, 1)
        self.main_layer.add(ground)
        ground.move_to(0, self.size[1] - ground.rect.height)

        hills = Sprite("65000000bc/hills_1")
        self.bg_layer.add(hills)
        hills.move_to(0, ground.rect.top - hills.rect.height)

        # Volcano
        self.volcano = Volcano()
        self.volcano.add_to(self)
        self.volcano.move_to(1400, ground.rect.top - self.volcano.rect.height + 1)

        blocker = Box(150, self.size[1] - self.volcano.rect.height - 20, (0, 0, 0, 0))
        self.main_layer.add(blocker)
        blocker.move_to(self.volcano.lava_pool.rect.right - 100, 0)

        # Left-side lava pool
        lava_pool = TiledSprite("65000000bc/lava_pool", 5, 1)
        lava_pool.lethal = True
        self.main_layer.add(lava_pool)
        lava_pool.move_to(self.volcano.rect.left - lava_pool.rect.width - 100, ground.rect.top - 18)

        # Platforms
        platform = FloatingSprite("65000000bc/platform")
        self.main_layer.add(platform)
        platform.move_to(lava_pool.rect.left + 250, lava_pool.rect.top - 10)

        platform = FloatingSprite("65000000bc/platform")
        self.main_layer.add(platform)
        platform.move_to(lava_pool.rect.left + 500, lava_pool.rect.top - 8)

        platform = FloatingSprite("65000000bc/platform")
        self.main_layer.add(platform)
        platform.move_to(lava_pool.rect.left + 750, lava_pool.rect.top - 12)

        # Right-side lava pool
        lava_pool = TiledSprite("65000000bc/lava_pool", 3, 1)
        lava_pool.lethal = True
        self.main_layer.add(lava_pool)
        lava_pool.move_to(self.volcano.rect.right + 200, ground.rect.top - 18)

        # Dynamite explosion trigger
        explosion_box = EventBox(self)
        explosion_box.rects.append(
            pygame.Rect(
                self.volcano.lava_puddle.rect.x,
                self.volcano.lava_puddle.rect.bottom - 5,
                self.volcano.lava_puddle.rect.width,
                5,
            )
        )
        explosion_box.watch_object_moves(self.level.dynamite)
        explosion_box.object_entered.connect(self.on_dynamite_placed)

        # Artifact
        self.level.add_artifact(self, lava_pool.rect.right + 200, ground.rect.top)
예제 #9
0
    def setup(self):
        super(Pyramid2300AD, self).setup()

        # Fall to your doom, probes!
        self.pit.remove()

        wall = TiledSprite(self.wall_name, 4, 3)
        self.main_layer.add(wall)
        wall.move_to(*self.weapons_entrance_pos)

        self.main_layer.add(self.level.flamethrower)
        self.level.flamethrower.move_to(
            wall.rect.right + 100,
            wall.rect.bottom - self.level.flamethrower.rect.height)

        wall = TiledSprite(self.wall_name, 2, 7)
        self.main_layer.add(wall)
        wall.move_to(self.topleft_platform.rect.left,
                     self.topleft_platform.rect.top - wall.rect.height)

        wall = TiledSprite(self.wall_name, 2, 7)
        self.main_layer.add(wall)
        wall.move_to(self.topleft_platform.rect.right - wall.rect.width,
                     self.topleft_platform.rect.top - wall.rect.height)

        button = Button('2300ad/button')
        button.pressed.connect(self.on_platforms_button_pressed)
        self.main_layer.add(button)
        button.move_to(wall.rect.left - button.rect.width,
                       self.topleft_platform.rect.top - button.rect.height - 10)

        wall = TiledSprite(self.wall_name, 15, 6)
        self.main_layer.add(wall)
        wall.move_to(self.topleft_platform.rect.right - wall.rect.width,
                     button.rect.top - wall.rect.height - 10)

        sign = Sprite('2300ad/weapons_sign')
        self.main_layer.add(sign)
        sign.move_to(button.rect.right - sign.rect.width,
                     wall.rect.bottom - sign.rect.height - 20)

        step = TiledSprite(self.wall_name, 2, 6)
        self.main_layer.add(step)
        step.move_to(self.pit.rect.left - step.rect.width,
                     self.ground_top - step.rect.height)
        x = step.rect.left

        step = TiledSprite(self.wall_name, 2, 4)
        self.main_layer.add(step)
        step.move_to(x - step.rect.width, self.ground_top - step.rect.height)
        x = step.rect.left

        step = TiledSprite(self.wall_name, 2, 2)
        self.main_layer.add(step)
        step.move_to(x - step.rect.width, self.ground_top - step.rect.height)

        platform_x = self.pit.rect.left
        platform_y = self.pit.rect.top - 500

        for x, y in self.PLATFORM_POS:
            platform = TogglePlatform()
            self.main_layer.add(platform)
            platform.move_to(platform_x + x, platform_y + y)
            self.platforms.append(platform)
예제 #10
0
    def setup(self):
        area_width, area_height = self.size

        tiles_y = area_height / 32
        wall = TiledSprite(self.wall_name, 4, tiles_y)
        self.main_layer.add(wall)
        wall.move_to(0, 0)

        ground = TiledSprite(self.ground_name, 10, 1)
        self.main_layer.add(ground)
        ground.move_to(wall.rect.right, area_height - ground.rect.height)
        self.ground_top = ground.rect.top

        self.pit = TiledSprite(self.spike_name, self.PIT_TILES_X, 1)
        self.pit.lethal = True
        self.main_layer.add(self.pit)
        self.pit.move_to(ground.rect.right,
                         ground.rect.bottom - self.pit.rect.height)

        ground = TiledSprite(self.ground_name, 5, 1)
        self.main_layer.add(ground)
        ground.move_to(self.pit.rect.right, area_height - ground.rect.height)

        self.topleft_platform = TiledSprite(self.wall_name, 25, 2)
        self.main_layer.add(self.topleft_platform)
        self.topleft_platform.move_to(self.PLATFORM_X, 200)

        platform = TiledSprite(self.wall_name, 20, 2)
        self.main_layer.add(platform)
        platform.move_to(ground.rect.left, self.PLATFORM_Y)

        tiles_y = (area_height - platform.rect.top) / 32 + 32
        wall = TiledSprite(self.wall_name, 15, tiles_y)
        self.main_layer.add(wall)
        wall.move_to(platform.rect.right, platform.rect.top)

        wall = TiledSprite(self.wall_name, 15, 4)
        self.main_layer.add(wall)
        wall.move_to(platform.rect.right, 0)
        wall_right = wall.rect.right
        wall_bottom = wall.rect.bottom

        self.weapons_entrance_pos = (wall.rect.left, wall.rect.bottom)

        wall = TiledSprite(self.wall_name, 5, 3)
        self.main_layer.add(wall)
        wall.move_to(wall_right - wall.rect.width, wall_bottom)
예제 #11
0
class Level2PyramidArea(Area):
    size = (4000, 800)

    DOOR_X = 230
    PLATFORM_X = DOOR_X + 600
    PLATFORM_Y = 224
    PIT_TILES_X = 65

    def __init__(self, *args, **kwargs):
        super(Level2PyramidArea, self).__init__(*args, **kwargs)
        self.key = 'pyramid'
        self.wall_name = None
        self.spike_name = None
        self.ground_name = None
        self.start_pos = (100,
                          self.size[1] - 64 - self.engine.player.rect.height)

    def setup(self):
        area_width, area_height = self.size

        tiles_y = area_height / 32
        wall = TiledSprite(self.wall_name, 4, tiles_y)
        self.main_layer.add(wall)
        wall.move_to(0, 0)

        ground = TiledSprite(self.ground_name, 10, 1)
        self.main_layer.add(ground)
        ground.move_to(wall.rect.right, area_height - ground.rect.height)
        self.ground_top = ground.rect.top

        self.pit = TiledSprite(self.spike_name, self.PIT_TILES_X, 1)
        self.pit.lethal = True
        self.main_layer.add(self.pit)
        self.pit.move_to(ground.rect.right,
                         ground.rect.bottom - self.pit.rect.height)

        ground = TiledSprite(self.ground_name, 5, 1)
        self.main_layer.add(ground)
        ground.move_to(self.pit.rect.right, area_height - ground.rect.height)

        self.topleft_platform = TiledSprite(self.wall_name, 25, 2)
        self.main_layer.add(self.topleft_platform)
        self.topleft_platform.move_to(self.PLATFORM_X, 200)

        platform = TiledSprite(self.wall_name, 20, 2)
        self.main_layer.add(platform)
        platform.move_to(ground.rect.left, self.PLATFORM_Y)

        tiles_y = (area_height - platform.rect.top) / 32 + 32
        wall = TiledSprite(self.wall_name, 15, tiles_y)
        self.main_layer.add(wall)
        wall.move_to(platform.rect.right, platform.rect.top)

        wall = TiledSprite(self.wall_name, 15, 4)
        self.main_layer.add(wall)
        wall.move_to(platform.rect.right, 0)
        wall_right = wall.rect.right
        wall_bottom = wall.rect.bottom

        self.weapons_entrance_pos = (wall.rect.left, wall.rect.bottom)

        wall = TiledSprite(self.wall_name, 5, 3)
        self.main_layer.add(wall)
        wall.move_to(wall_right - wall.rect.width, wall_bottom)
예제 #12
0
    def setup(self):
        level_width, level_height = self.size

        toxicwaste = TiledSprite('2300ad/toxicwaste', 5, 1)
        toxicwaste.lethal = True
        self.main_layer.add(toxicwaste)
        toxicwaste.move_to(0, level_height - toxicwaste.rect.height)

        ground = TiledSprite('2300ad/ground', 15, 1)
        self.main_layer.add(ground)
        ground.move_to(toxicwaste.rect.right, level_height - ground.rect.height)

        toxicwaste = TiledSprite('2300ad/toxicwaste', 8, 1)
        toxicwaste.lethal = True
        self.main_layer.add(toxicwaste)
        toxicwaste.move_to(ground.rect.right,
                           level_height - toxicwaste.rect.height)

        pyramid = Sprite('2300ad/pyramid')
        self.bg_layer.add(pyramid)
        pyramid.move_to(922, ground.rect.top - pyramid.rect.height)

        bubble = Sprite('2300ad/pyramid_bubble')
        self.bg_layer.add(bubble)
        bubble.move_to(
            pyramid.rect.left + (pyramid.rect.width - bubble.rect.width) / 2,
            ground.rect.top - bubble.rect.height)

        pole = LightningPole()
        self.main_layer.add(pole)
        pole.move_to(pyramid.rect.left + 100,
                     ground.rect.top - pole.rect.height)

        pole = LightningPole()
        self.main_layer.add(pole)
        pole.move_to(2600, ground.rect.top - pole.rect.height)

        self.main_layer.add(self.level.hoverboard)
        self.level.hoverboard.move_to(
            bubble.rect.right + 200,
            ground.rect.top - self.level.hoverboard.rect.height - 30)

        sign = QuarantineSign()
        self.main_layer.add(sign)
        sign.move_to(bubble.rect.left - sign.rect.width - 200,
                     ground.rect.top - 300)

        sign = QuarantineSign()
        self.main_layer.add(sign)
        sign.move_to(bubble.rect.right + 200, ground.rect.top - 300)
예제 #13
0
    def setup(self):
        level_width, level_height = self.size

        # Ground
        tiles_x = self.size[0] / 32
        ground = TiledSprite('ground', tiles_x, 1)
        self.main_layer.add(ground)
        ground.move_to(0, self.size[1] - ground.rect.height)

        building_rect = self.BUILDING_RECT.move(
            0, ground.rect.top - self.BUILDING_RECT.height)

        # Building background
        building_bg = Box(*building_rect.size)
        self.bg_layer.add(building_bg)
        building_bg.move_to(*building_rect.topleft)

        # First floor
        floor1 = Box(building_rect.width, self.GROUND_HEIGHT, self.FLOOR_COLOR)
        self.main_layer.add(floor1)
        floor1.move_to(building_rect.left, ground.rect.top)

        # Second floor
        floor2 = Box(building_rect.width, self.GROUND_HEIGHT, self.FLOOR_COLOR)
        self.main_layer.add(floor2)
        floor2.move_to(building_rect.left,
                       building_rect.top +
                       (building_rect.height - floor2.rect.height) / 2)

        # Left wall of building
        box = Box(self.WALL_WIDTH, building_rect.height, self.WALL_COLOR)
        self.main_layer.add(box)
        box.move_to(building_rect.left, building_rect.top)

        # Right wall of the building
        right_wall = Box(self.WALL_WIDTH, building_rect.height, self.WALL_COLOR)
        self.main_layer.add(right_wall)
        right_wall.move_to(building_rect.right - self.WALL_WIDTH,
                           building_rect.top)

        # Ceiling
        box = Box(building_rect.width, self.GROUND_HEIGHT)
        self.main_layer.add(box)
        box.move_to(building_rect.left, building_rect.top)

        # Top elevator
        elevator1 = Elevator()
        self.main_layer.add(elevator1)
        elevator1.move_to(building_rect.left + 100,
                          building_rect.top - elevator1.rect.height)

        # Bottom elevator
        elevator2 = Elevator()
        self.main_layer.add(elevator2)
        elevator2.move_to(elevator1.rect.left,
                          floor2.rect.top - elevator2.rect.height)

        # Link up the elevators
        elevator1.destination = elevator2
        elevator2.destination = elevator1

        # Dynamite
        self.main_layer.add(self.level.dynamite)
        self.level.dynamite.move_to(
            right_wall.rect.left - self.level.dynamite.rect.width - 20,
            floor2.rect.top - self.level.dynamite.rect.height)
        #self.level.dynamite.move_to(
        #    200, ground.rect.top - self.level.dynamite.rect.height)

        # Mountain
        mountain = Mountain()
        mountain.add_to(self)
        mountain.move_to(1300, ground.rect.top - mountain.rect.height)

        platform = Sprite('1999ad/lavamatics_platform')
        self.main_layer.add(platform)
        platform.move_to(1841,
                         mountain.rect.bottom - platform.rect.height - 500)

        platform = Sprite('1999ad/l_tube')
        self.main_layer.add(platform)
        platform.move_to(2140,
                         mountain.rect.bottom - platform.rect.height - 450)
예제 #14
0
    def setup(self):
        self.exploding = False
        self.exploded = False

        ground = TiledSprite('ground', self.size[0] / 32, 1)
        self.main_layer.add(ground)
        ground.move_to(0, self.size[1] - ground.rect.height)

        hills = Sprite('65000000bc/hills_1')
        self.bg_layer.add(hills)
        hills.move_to(0, ground.rect.top - hills.rect.height)

        # Volcano
        self.volcano = Volcano()
        self.volcano.add_to(self)
        self.volcano.move_to(
            1400, ground.rect.top - self.volcano.rect.height + 1)

        blocker = Box(150, self.size[1] - self.volcano.rect.height - 20,
                      (0, 0, 0, 0))
        self.main_layer.add(blocker)
        blocker.move_to(self.volcano.lava_pool.rect.right - 100, 0)

        # Left-side lava pool
        lava_pool = TiledSprite('65000000bc/lava_pool', 5, 1)
        lava_pool.lethal = True
        self.main_layer.add(lava_pool)
        lava_pool.move_to(self.volcano.rect.left - lava_pool.rect.width - 100,
                          ground.rect.top - 18)

        # Platforms
        platform = FloatingSprite('65000000bc/platform')
        self.main_layer.add(platform)
        platform.move_to(lava_pool.rect.left + 250, lava_pool.rect.top - 10)

        platform = FloatingSprite('65000000bc/platform')
        self.main_layer.add(platform)
        platform.move_to(lava_pool.rect.left + 500, lava_pool.rect.top - 8)

        platform = FloatingSprite('65000000bc/platform')
        self.main_layer.add(platform)
        platform.move_to(lava_pool.rect.left + 750, lava_pool.rect.top - 12)

        # Right-side lava pool
        lava_pool = TiledSprite('65000000bc/lava_pool', 3, 1)
        lava_pool.lethal = True
        self.main_layer.add(lava_pool)
        lava_pool.move_to(self.volcano.rect.right + 200,
                          ground.rect.top - 18)

        # Dynamite explosion trigger
        explosion_box = EventBox(self)
        explosion_box.rects.append(
            pygame.Rect(self.volcano.lava_puddle.rect.x,
                        self.volcano.lava_puddle.rect.bottom - 5,
                        self.volcano.lava_puddle.rect.width,
                        5))
        explosion_box.watch_object_moves(self.level.dynamite)
        explosion_box.object_entered.connect(self.on_dynamite_placed)

        # Artifact
        self.level.add_artifact(self, lava_pool.rect.right + 200,
                                ground.rect.top)