Advertisement
OtsoSilver

Untitled

Sep 12th, 2021
902
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. #pgzero
  2. import random
  3. # Игровое окно из клеток
  4. cell = Actor('border')
  5. cell1 = Actor("crack")
  6. cell2 = Actor('floor')
  7. cell3 = Actor('bones')
  8. size_w = 10 # Ширина поля в клетках
  9. size_h = 10 # Высота поля в клетках
  10. WIDTH = cell.width * size_w
  11. HEIGHT = cell.height * size_h
  12.  
  13. TITLE = "Подземелья" # Заголовок окна игры
  14. FPS = 30 # Количество кадров в секунду
  15.  
  16. my_map = [[0]*size_w]*size_h
  17.  
  18. def generate_map():
  19.     global my_map
  20.     for i in range(size_w):
  21.         for j in range(size_h):
  22.             if not i == 0 and not i == (size_w -1):
  23.                 if not j == 0 and not j == (size_w -1):
  24.                     my_map[i][j] = random.randint(1,3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement