AIprojekt-wozek/Grid.py
2022-04-04 20:08:45 +02:00

20 lines
556 B
Python

import pygame
WINDOW_X = 1400
WINDOW_Y = 750
RECT_SIZE = 50
RECT_COLOR = (70, 77, 87)
class Grid:
def __init__(self, window):
self.window = window
# function to draw a grid, it draws a line every 50px(RECT_SIZE) for both x and y axis
def draw_grid(self):
for x in range(RECT_SIZE, WINDOW_X, RECT_SIZE):
pygame.draw.line(self.window, (255, 255, 255), (x, 0), (x, WINDOW_Y))
for y in range(RECT_SIZE, WINDOW_Y, RECT_SIZE):
pygame.draw.line(self.window, (255, 255, 255), (0, y), (WINDOW_X, y))