Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions SNAKE/color.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Define colors
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
RED = (213, 50, 80) # Color for the food
GREEN = (0, 255, 0) # Color for the snake
BLUE = (50, 153, 213) # Background color

# Fill screen with background color
screen.fill(BLUE)

# Draw the snake in GREEN
pygame.draw.rect(screen, GREEN, [block[0], block[1], snake_block, snake_block])

# Draw the food in RED
pygame.draw.rect(screen, RED, [food_x, food_y, snake_block, snake_block])