import pygame, sys from pygame.math import Vector2 class FRUIT: def __init__(self): self.x = 5 self.y = 4 self.pos = Vector2(self.x, self.y) def draw_fruit(self): fruit_rect = pygame.Rect(self.pos.x, self.pos.y, w, h) pygame.draw.rect(surface, color, fruit_rect) pygame.init() cell_size = 40 cell_number = 20 screen = pygame.display.set_mode((20 * 40, 500)) clock = pygame.time.Clock() while True : for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit() screen.fill((175, 215, 70)) pygame.display.update() clock.tick(60)