Commit fdf8494c by BellCodeEditor

save project

parent ec9c8a86
Showing with 3 additions and 1 deletions
...@@ -16,7 +16,7 @@ left = pygame.image.load('left.png') ...@@ -16,7 +16,7 @@ left = pygame.image.load('left.png')
up = pygame.image.load('up.png') up = pygame.image.load('up.png')
down=pygame.image.load('down.png') down=pygame.image.load('down.png')
x,y=240, 120 x,y=240, 120
position=[(180,90),(180,120,),(210.120),(x,y)] position=[(180,90),(180,120,),(210,120),(x,y)]
snake_head=right snake_head=right
setheading='right' setheading='right'
while True: while True:
...@@ -46,6 +46,8 @@ while True: ...@@ -46,6 +46,8 @@ while True:
else: else:
y+=30 y+=30
# 将背景图画上去 # 将背景图画上去
position.append((x,y))
position.pop(0)
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
# 将贪吃蛇画上去 # 将贪吃蛇画上去
screen.blit(snake_head,position[-1]) screen.blit(snake_head,position[-1])
......
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