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 sucury.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,25 @@

CLOCK_TICKS = 7 # How fast the snake moves.

## This function is used to set the window size

def set_window_size():
global WIDTH, HEIGHT
try:
width = int(input("Enter the width of the window: "))
height = int(input("Enter the height of the window: "))
WIDTH, HEIGHT = width, height
except ValueError:
print("Invalid input. Using default window size.")



##
## Game implementation.
##

set_window_size()

pygame.init()

clock = pygame.time.Clock()
Expand Down