Advertisement
Guest User

Untitled

a guest
Mar 9th, 2021
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. class Board:
  2. def __init__(self, x, y, w, h, r, c):
  3. self.x = x
  4. self.y = y
  5. self.w = w
  6. self.h = h
  7. self.r = r
  8. self.c = c
  9. self.colors = [(255, 255, 255),
  10. (0, 0, 0)]
  11.  
  12. def draw(self):
  13. for i in range(self.r):
  14. for j in range(self.c):
  15. pygame.draw.rect(wn, self.colors[(j + i) % 2],
  16. (self.x + j * self.w,
  17. self.y + i * self.h,
  18. self.w, self.h))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement