#pgzero # Игровое окно из клеток cell = Actor("border") cell1 = Actor("floor") cell2 = Actor("crack") cell3 = Actor("bones") size_w = 7 # Ширина поля в клетках size_h = 7 # Высота поля в клетках WIDTH = cell.width * size_w HEIGHT = cell.height * size_h TITLE = "Подземелья" # Заголовок окна игры FPS = 30 # Количество кадров в секунду my_map = [[0,0,0,0,0,0,0], [0,1,2,1,3,1,0], [0,1,1,2,1,1,0], [0,3,2,1,1,3,0], [0,1,3,1,1,2,0], [0,1,1,1,3,1,0], [0,0,0,0,0,0,0]] def map_draw(): for i in range(len(my_map)): for j in range(len(my_map[0])): if my_map[i][j] == 0: cell.left = cell.width*j cell.top = cell.height*i cell.draw() elif my_map[i][j] == 1: cell1.left = cell1.width*j cell1.top = cell1.height*i cell1.draw() elif my_map[i][j] == 2: cell2.left = cell2.width*j cell2.top = cell2.height*i cell2.draw() elif my_map[i][j] == 3: cell3.left = cell3.width*j cell3.top = cell3.height*i cell3.draw() def draw(): map_draw()