Advertisement
OtsoSilver

Untitled

Oct 3rd, 2021
801
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.01 KB | None | 0 0
  1. #pgzero
  2.  
  3. # Игровое окно из клеток
  4. cell = Actor('border')
  5. cell1 = Actor('floor')
  6. cell2 = Actor('crack')
  7. cell3 = Actor('bones')
  8. size_w = 5 # Ширина поля в клетках
  9. size_h = 5 # Высота поля в клетках
  10. WIDTH = cell.width * size_w
  11. HEIGHT = cell.height * size_h
  12.  
  13. TITLE = "Подземелья" # Заголовок окна игры
  14. FPS = 30 # Количество кадров в секунду
  15. my_map = [[0,0,0,0,0,0,0],
  16.           [0,1,2,1,3,1,0],
  17.           [0,1,1,2,1,1,0],
  18.           [0,3,2,1,1,3,0],
  19.           [0,1,1,1,3,1,0],
  20.           [0,1,3,1,1,2,0],
  21.           [0,0,0,0,0,0,0]]
  22.          
  23.          
  24.          
  25. def map_draw():
  26.     for i in range(len(my_map)):
  27.         for j in range(len(my_map[0])):
  28.             if my_map[i][j] == 0:
  29.                 cell.left = cell.width*j
  30.                 cell.top = cell.height*i
  31.                 cell.draw()
  32.            
  33.                
  34.    
  35. def draw():
  36.     map_draw()
  37.    
  38.    
  39.    
  40.    
  41.    
  42.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement