diff --git a/Snake/src/window.py b/Snake/src/window.py index a08d411..a38ad8c 100644 --- a/Snake/src/window.py +++ b/Snake/src/window.py @@ -3,7 +3,30 @@ from pygame.locals import * def init_game(): pygame.init() - screen = pygame.display.set_mode((1280, 720), pygame.SCALED) - pygame.display.set_caption("Test Window") + screen = pygame.display.set_mode((1000, 525), pygame.SCALED) + pygame.display.set_caption("Snake") - return screen \ No newline at end of file + return screen + +def draw_level(S, M, difficulty, score, heigh, width): + WHITE = (255, 255, 255) # AIR + GREEN = (0, 255, 0) # SNAKE + BROWN = (255,248,220) # WALL + RED = (255, 0, 0) # APPLE + + Color = WHITE + + for j in range(heigh): + for i in range(width): + if M[j][i] == 0: + Color = WHITE + elif M[j][i] == 1: + Color = GREEN + elif M[j][i] == 2: + Color = BROWN + elif M[j][i] == 3: + Color = RED + + pygame.draw.rect(S, Color, pygame.Rect(i*25, j*25+25, 25, 25)) + + return S \ No newline at end of file