def set_level(lvl, plr): global board, all dmg = int(lvl) all = pygame.sprite.Group() board = Scene.Board(offset, "Levels/tileset_named", load_image("board.png", (255, 255, 255, 255)), "Levels/" + lvl, "Levels/obj_" + lvl, ["1", "2"], "5", "3", "6", 64) for coord in board.enemyes: x, y = coord vraszina = Persona.Enemy(player, 200, offset, load_image("enemy.png", (0, 0, 0, 255)), x, y, 64, 64, 3, 4, 6, ["move", "attack", "stay"], board, damage=dmg) all.add(vraszina) for coord in board.obj: x, y, t = coord if t: Scene.Exit(offset, all, load_image("ext.png"), player, x, y) else: Scene.Chest(offset, all, load_image("cht.png", (255, 255, 255, 255)), player, x, y, 2) x, y = plr player.set_coords(x, y) player.win = 0 player.inventory = 0 all.add(player) player.board = board player.hp = player.mx_hp
width, height = pygame.display.Info().current_w, pygame.display.Info().current_h running = True size = width, height screen = pygame.display.set_mode(size) COLOR_INACTIVE = pygame.Color('lightskyblue3') COLOR_ACTIVE = pygame.Color('dodgerblue2') FONT = pygame.font.Font(None, 32) fps = 100 # количество кадров в секунду offset = (100, 100) LEVEL = "1" ############# scene = pygame.sprite.Group() clock = pygame.time.Clock() ############# all = pygame.sprite.Group() board = Scene.Board(offset, "Levels/tileset_named", load_image("board.png", (255, 255, 255, 255)), "Levels/" + LEVEL, "Levels/obj_1", ["1", "2"], "5", "3", "6", 64) player = Persona.Player(offset, load_image("player.png", -1), 64, 64, 64, 64, 3, 4, 6, ["stay", "move", "attack"], board, speed=8, damage=5) set_level("1", (200, 200)) pygame.display.toggle_fullscreen() sound("background") class Menu: def __init__(self): # punkts = [100, 140, u'Punkts', (250, 250, 30), (250, 30, 250)] self.punkts = [] self.best = [] def render(self, powerhost, font, num_punkts):