2023-03-27 13:33:47 +02:00
|
|
|
import pygame
|
|
|
|
|
|
|
|
HORIZONTAL = 1250
|
|
|
|
VERTICAL = 750
|
|
|
|
|
|
|
|
TILE_SIZE = 50
|
|
|
|
|
2023-05-05 06:13:03 +02:00
|
|
|
line_color = (0, 0, 0)
|
2023-03-27 13:33:47 +02:00
|
|
|
|
2023-04-16 16:38:04 +02:00
|
|
|
|
2023-03-27 13:33:47 +02:00
|
|
|
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
|
2023-04-16 16:38:04 +02:00
|
|
|
pygame.draw.line(self.window, line_color, (0, y), (HORIZONTAL, y))
|