Closed Hakanbkl closed 1 year ago
Thanks for the report. Could you please remove the image and include the code as text? That's easy to parse for us. Also, please provide the entire pylint trace error. We will try to reproduce.
This indentation of pygame.draw
is wrong you need to move it 4 spaces to the right before the else. But this is something you should search on the web, pylint is just the messenger, this is not the right place to ask your question about python.
Bug description
I entered the text, please warn me if I did something wrong.(I am new here.) import pygame, sys, random
screen_width = 600 screen_height = 600 gridsize = 20 grid_width = screen_width / gridsize grid_height = screen_height / gridsize
light_green = (0,170,140) dark_green = (0,140,120) food_color = (250,200,0) snake_color = (34,34,34)
up = (0,-1) down = (0,+1) right = (1,0) left = (-1,0)
def drawGrid(surface): for y in range (0,int(grid_height)): for x in range (0,int(grid_width)): if (x + y) %2 == 0: light = pygame.Rect((x gridsize , y gridsize),(gridsize,gridsize)) pygame. draw.rect(surface,light_green,light) else: dark = pygame.Rect((xgridsize,ygridsize),(gridsize,gridsize)) pygame.draw.rect(surface,dark_green,dark)
def main(): pygame.init() screen = pygame.display.set_mode((screen_height,screen_width))
font = pygame.font.SysFont("Segeo UI Black",20) surface = pygame.Surface(screen.get_size()) surface = surface.convert()
while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit()
Configuration
No response
Command used
Pylint output
Expected behavior
dont know
Pylint version
OS / Environment
windows 10
Additional dependencies
No response