Commit c7bfd696 by BellCodeEditor

auto save

parent f49dd7bc
Showing with 7 additions and 3 deletions
......@@ -15,6 +15,7 @@ left=pygame.image.load("left.png")
down=pygame.image.load("down.png")
up=pygame.image.load("up.png")
ziti=pygame.font.Font("neuropol.ttf",18)
x=240
y=120
......@@ -27,6 +28,7 @@ tou=right
apple_x=360
apple_y=300
fenshu=0
while True:
for event in pygame.event.get():
......@@ -61,6 +63,7 @@ while True:
num2=random.randint(1,16)
apple_x=num1*30-30
apple_y=num2*30-30
fenshu+=10
else:
position.pop(0)
......@@ -70,7 +73,9 @@ while True:
for i in range(len(position)-1):
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()
FPS.tick(3)
\ No newline at end of file
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