AIprojekt-wozek/Grid.py

19 lines
657 B
Python

import pygame
from Global_variables import Global_variables as G_var
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(G_var().RECT_SIZE, G_var().WINDOW_X, G_var().RECT_SIZE):
pygame.draw.line(self.window, (255, 255, 255),
(x, 0), (x, G_var.WINDOW_Y))
for y in range(G_var().RECT_SIZE, G_var.WINDOW_Y, G_var().RECT_SIZE):
pygame.draw.line(self.window, (255, 255, 255),
(0, y), (G_var().WINDOW_X, y))