bir yılan oyunu yapıyorum ve kodlarım yarım kaldı kodu benim için tamamlar mısın?

oyunumun kodu:

import pygame
import time
import random
import os

# Initialize Pygame
pygame.init()

# Define the colors
white = (255, 255, 255)
black = (0, 0, 0)
red = (213, 50, 80)
green = (0, 255, 0)
yellow = (255, 255, 0)
blue = (50, 153, 213)
dark_green = (0, 100, 0)

# Set the width and height of the window
dis_width = 600
dis_height = 400

# Create the window
dis = pygame.display.set_mode((dis_width, dis_height))
pygame.display.set_caption(‘Snake Game’)

clock = pygame.time.Clock()

snake_block = 10
initial_snake_speed = 5
level_up_score = 20
num_red_foods = 3
num_yellow_foods = 1

font_style = pygame.font.SysFont(None, 35)
score_font = pygame.font.SysFont(None, 25)

max_score_file = ‘max_score.txt’

class Snake:
    def init(self, x, y, color, controls):
        self.x = x
        self.y = y
        self.x_change = 0
        self.y_change = 0
        self.direction = ‘RIGHT’
        self.snake_List = []
        self.Length_of_snake = 1
        self.color = color
        self.controls = controls

    def move(self, key):
        if key == self.controls[‘left’] and self.direction != ‘RIGHT’:
            self.x_change = -snake_block
            self.y_change = 0
            self.direction = ‘LEFT’
        elif key == self.controls[‘right’] and self.direction != ‘LEFT’:
            self.x_change = snake_block
            self.y_change = 0
            self.direction = ‘RIGHT’
        elif key == self.controls[‘up’] and self.direction != ‘DOWN’:
            self.y_change = -snake_block
            self.x_change = 0
            self.direction = ‘UP’
        elif key == self.controls[‘down’] and self.direction != ‘UP’:
            self.y_change = snake_block
            self.x_change = 0
            self.direction = ‘DOWN’

    def update_position(self):
        self.x += self.x_change
        self.y += self.y_change
        snake_Head = [self.x, self.y]
        self.snake_List.append(snake_Head)
        if len(self.snake_List) > self.Length_of_snake:
            del self.snake_List[0]

    def check_collision(self):
        if self.x >= dis_width or self.x < 0 or self.y >= dis_height or self.y < 0:
            return True
        for x in self.snake_List[:-1]:
            if x == [self.x, self.y]:
                return True
        return False

    def draw(self):
        for x in self.snake_List:
            pygame.draw.rect(dis, self.color, [x[0], x[1], snake_block, snake_block])

class Food:
    def init(self, color, points, length_increase):
        self.color = color
        self.points = points
        self.length_increase = length_increase
        self.position = self.generate_food_position()

    def generate_food_position(self):
        return (
            round(random.randrange(0, dis_width - snake_block) / 10.0) * 10.0,
            round(random.randrange(0, dis_height - snake_block) / 10.0) * 10.0
        )

    def draw(self):
        pygame.draw.rect(dis, self.color, [self.position[0], self.position[1], snake_block, snake_block])

class Game:
    def init(self):
        self.max_score = self.read_max_score()
        self.snakes = [
            Snake(dis_width / 2, dis_height / 2, green, {‘left’: pygame.K_LEFT, ‘right’: pygame.K_RIGHT, ‘up’: pygame.K_UP, ‘down’: pygame.K_DOWN})
        ]
        self.foods = []
        for _ in range(num_red_foods):
            self.foods.append(Food(red, 1, 1))
        for _ in range(num_yellow_foods):
            self.foods.append(Food(yellow, 5, 2))

    def read_max_score(self):
        if not os.path.exists(max_score_file):
            return 0
        with open(max_score_file, ‘r’) as file:
            return int(file.read())

    def write_max_score(self):
        with open(max_score_file, ‘w’) as file:
            file.write(str(self.max_score))

    def main_menu(self):
        while True:
            dis.fill(black)
            self.message(‘Welcome to Snake Game!’, green, [dis_width / 6, dis_height / 4])
            self.message(‘Press 1 for Single Player’, white, [dis_width / 6, dis_height / 2])
            self.message(‘Press 2 for Multiplayer’, white, [dis_width / 6, dis_height / 2 + 50])
            pygame.display.update()

            for event in pygame.event.get():
                if event.type == pygame.KEYDOWN:
                    if event.key == pygame.K_1:
                        self.snakes = [
                            Snake(dis_width / 2, dis_height / 2, green, {‘left’: pygame.K_LEFT, ‘right’: pygame.K_RIGHT, ‘up’: pygame.K_UP, ‘down’: pygame.K_DOWN})
                        ]
                        self.game_loop()
                    if event.key == pygame.K_2:
                        self.snakes = [
                            Snake(dis_width / 2, dis_height / 2, green, {‘left’: pygame.K_LEFT, ‘right’: pygame.K_RIGHT, ‘up’: pygame.K_UP, ‘down’: pygame.K_DOWN}),
                            Snake(dis_width / 4, dis_height / 4, blue, {‘left’: pygame.K_a, ‘right’: pygame.K_d, ‘up’: pygame.K_w, ‘down’: pygame.K_s})
                        ]
                        self.game_loop()
                if event.type == pygame.QUIT:
                    pygame.quit()
                    quit()

    def message(self, msg, color, position):
        mesg = font_style.render(msg, True, color)
        dis.blit(mesg, position)

    def display_score(self, score, max_score, level):
        value = score_font.render("Score: " + str(score), True, white)
        high_score = score_font.render("Max Score: " + str(max_score), True, white)
        level_text = score_font.render("Level: " + str(level), True, white)
        dis.blit(value, [0, 0])
        dis.blit(high_score, [0, 25])
        dis.blit(level_text, [0, 50])

    def game_loop(self):
        game_over = False
        game_close = False

        score = 0
        level = 0
        snake_speed = initial_snake_speed

        while not game_over:
            while game_close:
                dis.fill(blue)
                self.message(‘You Lost! Press Q-Quit or C-Play Again’, red, [dis_width / 10, dis_height / 3])
                self.display_score(score, self.max_score, level)
                pygame.display.update()

                for event in pygame.event.get():
                    if event.type == pygame.KEYDOWN:
                        if event.key == pygame.K_q:
                            game_over = True
                            game_close = False
                        if event.key == pygame.K_c:
                            self.write_max_score()
                            self.main_menu()

            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    game_over = True
                if event.type == pygame.KEYDOWN:
                    for snake in self.snakes:
                        snake.move(event.key)

            for snake in self.snakes:
                if snake.check_collision():
                    game_close = True

            for snake in self.snakes:
                snake.update_position()
                if self.check_food_collision(snake):
                    score += snake.Length_of_snake - 1
                    if score > self.max_score:
                        self.max_score = score
                    level = score // level_up_score
                    snake_speed = initial_snake_speed + level

            dis.fill(black)
            for snake in self.snakes:
                snake.draw()
            for food in self.foods:
                food.draw()
            self.display_score(score, self.max_score, level)
            pygame.display.update()

            clock.tick(s