import pygame

import pygame

WIDTH = 480  # Ширина игрового окна
HEIGHT = 600  # Высота
FPS = 60  # Кадры в секунду

WHITE = (255, 255, 255)  # Белый
BLACK = (0, 0, 0)  # Черный
RED = (255, 0, 0)  # Красный
GREEN = (0, 255, 0)  # Зеленый
BLUE = (0, 0, 255)  # Синий
VIOLET = (238, 130, 238)  # Цвет на выбор
OLIVE = (128, 128, 0) #оливье
STEELBLUE = (70, 130, 180) #блевония

pygame.init()
pygame.mixer.init()
screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("чичигага")
clock = pygame.time.Clock

snake_block = 10
snake_speed = 15

class Snake(pygame.sprite.Sprite):
    def __init__(self):
        super().__init__()
        self.image = pygame.Surface((snake_block,snake_block))
        self.image.fill(STEELBLUE)
        self.image = self.image.get_rect()
        self.rect.x = WIDTH/2
        self.rect.y = HEIGHT/2
        self.dx = 0
        self.dy = 0
        self.body = []
        self.lenght = 1
        self.score = 0
    def update(self):
        self.rect.y += self.dy
        self.rect.x += self.dx

        self.body.append[self.rect.x, self.rect.y]
        if len(self.body)>self.lenght:
            del self.body[0]

        for segment in self.body[:-1]
            if segment[0] == self.rect.x and segment[1] == self.rect.y:
                return False
        return True
    def draw_body(self,surfase):
        for segment in self.body[:-1]:
            pygame.draw.rect(surfase, BLACK, segment[0], segment[1], snake_block, snake_block)

    def grow(self):
        self.lenght += 1  #self.lenght = self.lenght + 1
        self.score += 1


class Food(pygame.sprite.Sprite):
    def __init__(self):
        super().__init__()
        self.image = pygame.Surface((snake_block, snake_block))
        self.image.fill(OLIVE)
        self.image = self.image.get_rect()


#clock = pygame.time.Clock()
all_sprites = pygame.sprite.Group()
player = Player()
all_sprites.add(player)


class Player(pygame.sprite.Sprite)



running = True
while running:

    clock.tick(FPS)

    for event in pygame.event.get():
        if event.type == pygame.QUIT
            running = False
    all_sprites.update()




    screen.fill(WHITE)
    all_sprites.draw(screen)
    pygame.display.flip()


pygame.quit()