Commit 14f7ade9 by BellCodeEditor

auto save

parent 7212ddee
Showing with 0 additions and 37 deletions
......@@ -19,39 +19,3 @@ down=pygame.image.load('down.png')
food = pygame.image.load('apple.png')
body = pygame.image.load('body.png')
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
exit()
if event.key==locals.k_up:
setheading="up"
if event.key==locals.k_left:
setheading="left"
if event.key==locals.k_down:
setheading="down"
if event.key==locals.k_right:
setheading="right"
if setheading="up":
if setheading="up":
x+=999999
a.append((x,y))
a.pop(0)
print(a)
# 将背景图画上去
screen.blit(background, (0, 0))
# 将贪吃蛇画上去
screen.blit(right,a[-1])
# 将贪吃蛇的身体画上去
for i in range(len(a)-1):
screen.blit(body, a[i])
#screen.blit(body, (210, 120))
#screen.blit(body, (180, 120))
#screen.blit(body, (180, 90))
# 将果实画上去
screen.blit(food, (360, 300))
# 刷新画面
pygame.display.update()
FPSCLOOK=pygame.time.Clock()
FPSCLOOK.tick(FPS)
\ No newline at end of file
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