Commit 521ade2b by BellCodeEditor

auto save

parent 6e6b67e0
Showing with 7 additions and 3 deletions
...@@ -23,7 +23,7 @@ x, y = 240, 120 ...@@ -23,7 +23,7 @@ x, y = 240, 120
position = [(180, 90), (180, 120), (210, 120), (x, y)] position = [(180, 90), (180, 120), (210, 120), (x, y)]
h_x=360 h_x=360
h_y=300 h_y=300
s = 0
setheading = "right" setheading = "right"
snake_head = right snake_head = right
...@@ -62,6 +62,7 @@ while True: ...@@ -62,6 +62,7 @@ while True:
m2=random.randint(1,16) m2=random.randint(1,16)
h_x=30*m1-30 h_x=30*m1-30
h_y=30*m2-30 h_y=30*m2-30
s+=10
else: else:
position.pop(0) position.pop(0)
...@@ -77,9 +78,11 @@ while True: ...@@ -77,9 +78,11 @@ while True:
# 将果实画上去 # 将果实画上去
screen.blit(food, (h_x, h_y)) screen.blit(food, (h_x, h_y))
info="Screen"+str(screen) info="Score"+str(s)
text=my_foot.render(info,True,(0,0,0)) text=my_foot.render(info,True,(0,0,0))
screen.blit(text)
screen.blit(text,(500,10))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPSCLOCK.tick(3) FPSCLOCK.tick(3)
\ 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