AIprojekt-wozek/Grid.py

20 lines
556 B
Python
Raw Normal View History

2022-03-24 20:02:21 +01:00
import pygame
WINDOW_X = 1400
WINDOW_Y = 750
RECT_SIZE = 50
2022-04-04 20:08:45 +02:00
RECT_COLOR = (70, 77, 87)
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(RECT_SIZE, WINDOW_X, RECT_SIZE):
2022-03-24 20:02:21 +01:00
pygame.draw.line(self.window, (255, 255, 255), (x, 0), (x, WINDOW_Y))
2022-04-04 20:08:45 +02:00
for y in range(RECT_SIZE, WINDOW_Y, RECT_SIZE):
pygame.draw.line(self.window, (255, 255, 255), (0, y), (WINDOW_X, y))