Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
632 B
2
Indexable
Never
import pygame
import sys
import random

# Initialize Pygame
pygame.init()

# Set up game variables
width, height = 400, 400
snake_size = 20
snake_speed = 15

# Colors
white = (255, 255, 255)
black = (0, 0, 0)
red = (255, 0, 0)

# Initialize game window
window = pygame.display.set_mode((width, height))
pygame.display.set_caption("Snake Game")

# Initialize clock
clock = pygame.time.Clock()

# Initialize snake
snake = [(100, 100), (90, 100), (80, 100)]
snake_direction = "RIGHT"

# Initialize food
food_position = (random.randrange(1, (width//snake_size)) * snake_size,
                 random.randrange(1, (height//snake_size)) 
Leave a Comment