SHARE
TWEET

Untitled

a guest Oct 21st, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pygame
  2.  
  3. pygame.init()
  4.  
  5. class Main(object):
  6.     def __init__(self, width, height, tilesize, color):
  7.         self.width = width
  8.         self.height = height
  9.         self.tilesize = tilesize
  10.         self.color = color
  11.         self.gridwidth = self.width / self.tilesize
  12.         self.gridheight = self.height / self.tilesize
  13.         self.window = pygame.display.set_mode((self.width, self.height))
  14.        
  15.  
  16.     def draw_grid(self):
  17.         for x in range(0, self.width, self.tilesize):
  18.             pygame.draw.line(self.window, self.color, (x, 0), (x, self.height))
  19.         for y in range(0, self.height, self.tilesize):
  20.             pygame.draw.line(self.window, self.color, (0, y), (self.width, y))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top