AIprojekt-wozek/Grid.py

19 lines
657 B
Python
Raw Normal View History

2022-03-24 20:02:21 +01:00
import pygame
from Global_variables import Global_variables as G_var
2022-03-24 20:02:21 +01:00
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):
2022-04-04 20:08:45 +02:00
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))
2022-04-04 20:08:45 +02:00
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))