import random
import pygame
from os import path

# Настройки экрана и FPS
WIDTH = 1840
HEIGHT = 1000
FPS = 30

# Цветовые константы
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
VIOLET = (238, 130, 238)

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(WHITE)
        self.rect = self.image.get_rect()




# Инициализация Pygame
pygame.init()
pygame.mixer.init()
screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("My Game")
clock = pygame.time.Clock()

# Группы спрайтов
all_sprites = pygame.sprite.Group()

snake = snake()
all_sprites.add(snake)



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()

