Skip to content

Commit

Permalink
Merge pull request barryclark#4 from chaelimee/main
Browse files Browse the repository at this point in the history
make G-snake.py
  • Loading branch information
ParkJeonghyeon1013 authored Oct 4, 2023
2 parents 5fdbd6b + 73c984b commit 7d4c21a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions G-snake.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7d4c21a

Please sign in to comment.