Commit 09b60479 by BellCodeEditor

save project

parent 6703bb11
Showing with 2 additions and 1 deletions
...@@ -57,6 +57,7 @@ while True: ...@@ -57,6 +57,7 @@ while True:
y += 30 y += 30
position.append((x, y)) position.append((x, y))
if x == apple_x and y == apple_y: if x == apple_x and y == apple_y:
score+=1
apple_x = random.randint(0,21)*30 apple_x = random.randint(0,21)*30
apple_y = random.randint(0,15)*30 apple_y = random.randint(0,15)*30
else: else:
...@@ -79,7 +80,7 @@ while True: ...@@ -79,7 +80,7 @@ while True:
screen.blit(text, (540, 10)) screen.blit(text, (540, 10))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPSCLOCK.tick(5) FPSCLOCK.tick(2)
......
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