Commit cec796c7 by BellCodeEditor

save project

parent 37d7f2f7
Showing with 4 additions and 0 deletions
...@@ -16,6 +16,7 @@ body = pygame.image.load('body.png') # 身体 ...@@ -16,6 +16,7 @@ body = pygame.image.load('body.png') # 身体
left = pygame.image.load('left.png') # 头 朝左 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') # 头 朝下
my_
x, y = 240, 120 x, y = 240, 120
apple_x,apple_y=360,300 apple_x,apple_y=360,300
...@@ -62,6 +63,9 @@ while True: ...@@ -62,6 +63,9 @@ while True:
# 将贪吃蛇的头画上去 # 将贪吃蛇的头画上去
screen.blit(snake_head, position[-1]) screen.blit(snake_head, position[-1])
# 将贪吃蛇的身体画上去 # 将贪吃蛇的身体画上去
info = "score:"+str(score)
text = my_font.render(info,true,(0,0,0))
screen.blit(text,(540,10))
for i in range(len(position)-1): for i in range(len(position)-1):
screen.blit(body, position[i]) screen.blit(body, position[i])
......
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