Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- WIDTH = 800
- WIN = pygame.display.set_mode((WIDTH, WIDTH))
- GREY = (128, 128, 128)
- def draw_grid(win, width):
- square_count = 50
- square_size = width // square_count
- for i in range(square_count):
- pygame.draw.line(win, GREY, (0, i*square_size), (width, i*square_size))
- pygame.draw.line(win, GREY, (i*square_size, 0), (i*square_size, width))
- pygame.display.update()
- run = True
- square_count = 50
- draw_grid(WIN, WIDTH)
- while run:
- for event in pygame.event.get():
- if event.type == pygame.QUIT:
- run = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement