24 lines
605 B
Python
24 lines
605 B
Python
|
import pygame
|
||
|
|
||
|
HORIZONTAL = 1250
|
||
|
VERTICAL = 750
|
||
|
|
||
|
TILE_SIZE = 50
|
||
|
|
||
|
line_color = (85, 85, 85)
|
||
|
|
||
|
class Grid:
|
||
|
def __init__(self, window):
|
||
|
self.window = window
|
||
|
|
||
|
def drawGrid(self):
|
||
|
num_of_columns = int(HORIZONTAL / TILE_SIZE)
|
||
|
num_of_rows = int(VERTICAL / TILE_SIZE)
|
||
|
x = 0
|
||
|
y = 0
|
||
|
for i in range(num_of_columns):
|
||
|
x += TILE_SIZE
|
||
|
pygame.draw.line(self.window, line_color, (x, 0), (x, VERTICAL))
|
||
|
for i in range(num_of_rows):
|
||
|
y += TILE_SIZE
|
||
|
pygame.draw.line(self.window, line_color, (0, y), (HORIZONTAL, y))
|