Commit c7bfd696 by BellCodeEditor

auto save

parent f49dd7bc
Showing with 6 additions and 1 deletions
...@@ -15,6 +15,7 @@ left=pygame.image.load("left.png") ...@@ -15,6 +15,7 @@ left=pygame.image.load("left.png")
down=pygame.image.load("down.png") down=pygame.image.load("down.png")
up=pygame.image.load("up.png") up=pygame.image.load("up.png")
ziti=pygame.font.Font("neuropol.ttf",18)
x=240 x=240
y=120 y=120
...@@ -27,6 +28,7 @@ tou=right ...@@ -27,6 +28,7 @@ tou=right
apple_x=360 apple_x=360
apple_y=300 apple_y=300
fenshu=0
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
...@@ -61,6 +63,7 @@ while True: ...@@ -61,6 +63,7 @@ while True:
num2=random.randint(1,16) num2=random.randint(1,16)
apple_x=num1*30-30 apple_x=num1*30-30
apple_y=num2*30-30 apple_y=num2*30-30
fenshu+=10
else: else:
position.pop(0) position.pop(0)
...@@ -70,7 +73,9 @@ while True: ...@@ -70,7 +73,9 @@ while True:
for i in range(len(position)-1): for i in range(len(position)-1):
screen.blit(body, position[i]) screen.blit(body, position[i])
info="score:"+str(fenshu)
text=ziti.render(info,True,(255,0,0))
screen.blit(text,(520,10))
pygame.display.update() pygame.display.update()
FPS.tick(3) FPS.tick(3)
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