Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Board:
- def __init__(self, x, y, w, h, r, c):
- self.x = x
- self.y = y
- self.w = w
- self.h = h
- self.r = r
- self.c = c
- self.colors = [(255, 255, 255),
- (0, 0, 0)]
- self.rects = [
- (
- self.colors[(j + i) % 2],
- pygame.Rect(self.x + j * w,
- y + i * h,
- w, h)
- )
- for i in range(r)
- for j in range(c)]
- def draw(self):
- for color, rect in self.rects:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement