Commit 0f6a605c by BellCodeEditor

save project

parent 5d4cd5cb
Showing with 8 additions and 17 deletions
...@@ -15,20 +15,8 @@ body = pygame.image.load('body.png') ...@@ -15,20 +15,8 @@ body = pygame.image.load('body.png')
x=240 x=240
y=120 y=120
poor=[(,),(,),(,),(,)]
FPSCLOCK=pygame.time.Clock()
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
...@@ -36,7 +24,9 @@ while True: ...@@ -36,7 +24,9 @@ while True:
# 接收到退出事件后退出程序 # 接收到退出事件后退出程序
exit() exit()
x+=30 x+=30
# 将背景图画上去 poor.append((x,y))
poor.pop(0)
#图画上去
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
# 将贪吃蛇画上去 # 将贪吃蛇画上去
screen.blit(right, (x, y)) screen.blit(right, (x, y))
...@@ -47,4 +37,6 @@ while True: ...@@ -47,4 +37,6 @@ while True:
# 将果实画上去 # 将果实画上去
screen.blit(food, (360, 300)) screen.blit(food, (360, 300))
# 刷新画面 # 刷新画面
pygame.display.update() FPSCLOCK.tick(1.1)
\ No newline at end of file pygame.display.update()
for poor
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