def create_walls(self): # Создаем стены и платформы platform_coords = [[0, 0, 10, 600], [790, 0, 10, 600], [0, 590, 600, 10], [450, 500, 20, 100], [250, 550, 20, 60], [550, 450, 250, 10]] for coord in platform_coords: platform = game_object.Platform(coord[0], coord[1], coord[2], coord[3]) self.artifact_list.add(platform) self.all_sprite_list.add(platform)
def create_walls(self): platform_coords = [[200, 450], [200, 500], [200, 550], [300, 500], [300, 550], [400, 450], [450, 450], [550, 350], [600, 350], [700, 300], [750, 300], [850, 250], [900, 250], [850, 550], [900, 550], [950, 450], [1100, 500], [1100, 550], [1150, 400], [1150, 450], [1150, 500], [1150, 550], [1300, 400], [1400, 400], [1500, 400]] for coord in platform_coords: platform = game_object.Platform(coord[0], coord[1], 0) self.platform_list.add(platform) self.all_sprite_list.add(platform)
def create_walls(self): # Создаем стены и платформы platform_coords = [ [0, 600], [155, 345], [320, 350], [550, 245], [735, 125], [0, 300], [0, 590], ] for coord in platform_coords: platform = game_object.Platform(coord[0], coord[1]) self.platform_list.add(platform) self.all_sprite_list.add(platform)
def load_stage(self, stage_num): for r in range(ROW_COUNT): for c in range(COL_COUNT): if gd.stages[stage_num][r][c] == '.': file_name = gd.img_world[0] if c < COL_COUNT-1: self.plat_grid[r][c] = gobj.Platform(file_name, r, c) self.move_grid[r][c] = 1 else: # cannot be here except the beginning of stage if r < stage_num: self.plat_grid[r][c] = gobj.Platform(gd.img_fruit[r], r, c) else: self.plat_grid[r][c] = gobj.Platform(file_name, r, c) self.move_grid[r][c] = 0 self.kill_grid[r][c] = False elif gd.stages[stage_num][r][c] == '2': file_name = gd.img_world[1] self.plat_grid[r][c] = gobj.Platform(file_name, r, c) self.move_grid[r][c] = 2 self.kill_grid[r][c] = False elif gd.stages[stage_num][r][c] == '3': file_name = gd.img_world[2] self.plat_grid[r][c] = gobj.Platform(file_name, r, c) self.move_grid[r][c] = 3 self.kill_grid[r][c] = False elif gd.stages[stage_num][r][c] == '4': file_name = gd.img_world[3] self.plat_grid[r][c] = gobj.Platform(file_name, r, c) self.move_grid[r][c] = 4 self.kill_grid[r][c] = False elif gd.stages[stage_num][r][c] == '5': file_name = gd.img_world[4] self.plat_grid[r][c] = gobj.Platform(file_name, r, c) self.move_grid[r][c] = 5 self.kill_grid[r][c] = False elif gd.stages[stage_num][r][c] == '6': file_name = gd.img_world[5] self.plat_grid[r][c] = gobj.Platform(file_name, r, c) self.move_grid[r][c] = 6 self.kill_grid[r][c] = False elif gd.stages[stage_num][r][c] == '7': file_name = gd.img_world[6] self.plat_grid[r][c] = gobj.Platform(file_name, r, c) self.move_grid[r][c] = 7 self.kill_grid[r][c] = True elif gd.stages[stage_num][r][c] == '#': file_name1 = gd.img_fruit[stage_num] file_name2 = gd.img_world[0] self.plat_grid[r][c] = gobj.Item(file_name1, file_name2, r, c) self.move_grid[r][c] = 8 self.kill_grid[r][c] = False elif gd.stages[stage_num][r][c] == 'a': file_name1 = gd.img_world[7] file_name2 = gd.img_world[0] self.plat_grid[r][c] = gobj.Item(file_name1, file_name2, r, c) self.move_grid[r][c] = 9 self.kill_grid[r][c] = False elif gd.stages[stage_num][r][c] == 'b': file_name1 = gd.img_world[7] file_name2 = gd.img_world[0] self.plat_grid[r][c] = gobj.Item(file_name1, file_name2, r, c) self.move_grid[r][c] = 10 self.kill_grid[r][c] = False elif gd.stages[stage_num][r][c] == 'c': file_name1 = gd.img_world[7] file_name2 = gd.img_world[0] self.plat_grid[r][c] = gobj.Item(file_name1, file_name2, r, c) self.move_grid[r][c] = 11 self.kill_grid[r][c] = False # Enemy1 is hidden inside this; it always appear on the right of the bonus bag self.enemy_list.append(gobj.Enemy1(gd.enemy_speeds[stage_num][4], r, c+1))