From 73c984b16132a9910857d7df10a15401eee42975 Mon Sep 17 00:00:00 2001 From: chaelimee Date: Wed, 4 Oct 2023 16:58:53 +0900 Subject: [PATCH] make G-snake.py --- G-snake.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/G-snake.py b/G-snake.py index e69de29bb2d1d..d513843839ef5 100644 --- a/G-snake.py +++ b/G-snake.py @@ -0,0 +1,28 @@ +# Make G-snake.py +import pygame + +#게임 화면의 크기, 색상 등을 정의 +white = (255, 255, 255) +black = (0, 0, 0) +red = (213, 50, 80) +green = (0, 255, 0) +blue = (50, 153, 213) + +display_width = 600 +display_height = 400 + +dis = pygame.display.set_mode((display_width, display_height)) +pygame.display.set_caption('Snake Game') + +#뱀과 먹이를 정의 +snake_block = 10 +snake_speed = 15 +x1 = display_width / 2 +y1 = display_height / 2 +x1_change = 0 +y1_change = 0 +snake_List = [] +Length_of_snake = 1 + +foodx = round(random.randrange(0, display_width - snake_block) / 10.0) * 10.0 +foody = round(random.randrange(0, display_height - snake_block) / 10.0) * 10.0