3 examples of 'pygame grid' in Python

Every line of 'pygame grid' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
354def drawGrid():
355 return #do nothing
356 for x in range(0, WINDOWWIDTH, CELLSIZE): # draw vertical lines
357 pygame.draw.line(DISPLAYSURF, DARKGRAY, (x, 0), (x, WINDOWHEIGHT))
358 for y in range(0, WINDOWHEIGHT, CELLSIZE): # draw horizontal lines
359 pygame.draw.line(DISPLAYSURF, DARKGRAY, (0, y), (WINDOWWIDTH, y))
106def draw_Grid():
107 # 垂直方向
108 for x in range(0, Window_Width, Cell_Size):
109 pygame.draw.line(Main_Display, (40, 40, 40), (x, 0), (x, Window_Height))
110 # 水平方向
111 for y in range(0, Window_Height, Cell_Size):
112 pygame.draw.line(Main_Display, (40, 40, 40), (0, y), (Window_Width, y))
212def drawGrid():
213 for x in range(0, WINDOWWIDTH, CELLSIZE): # draw vertical lines
214 pygame.draw.line(DISPLAYSURF, DARKGRAY, (x, 0), (x, WINDOWHEIGHT))
215 for y in range(0, WINDOWHEIGHT, CELLSIZE): # draw horizontal lines
216 pygame.draw.line(DISPLAYSURF, DARKGRAY, (0, y), (WINDOWWIDTH, y))

Related snippets