Commit aee97772 by BellCodeEditor

save project

parent aa917da6
Showing with 5 additions and 1 deletions
...@@ -4,7 +4,7 @@ from pygame import locals ...@@ -4,7 +4,7 @@ from pygame import locals
# 初始化pygame,为使用硬件做准备 # 初始化pygame,为使用硬件做准备
pygame.init() pygame.init()
x,y=240,120 x,y=240,120
USB=[(210, 120),(180, 120),(180, 90),(x,y)] USB=[(210, 120),(180, 90),(180, 90),(x,y)]
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((660, 480)) screen = pygame.display.set_mode((660, 480))
...@@ -17,6 +17,9 @@ right = pygame.image.load('right.png') ...@@ -17,6 +17,9 @@ right = pygame.image.load('right.png')
food = pygame.image.load('apple.png') food = pygame.image.load('apple.png')
body = pygame.image.load('body.png') body = pygame.image.load('body.png')
FPSCLock=pygame.time.Clock() FPSCLock=pygame.time.Clock()
setheading = "right" setheading = "right"
...@@ -48,6 +51,7 @@ while True: ...@@ -48,6 +51,7 @@ while True:
a=right
# 将背景图画上去 # 将背景图画上去
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
# 将贪吃蛇画上去 # 将贪吃蛇画上去
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment