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)
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)
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)
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)