Commit c8a39e36 by BellCodeEditor

save project

parent 9d8a1c38
Showing with 5 additions and 2 deletions
...@@ -49,6 +49,8 @@ while True: ...@@ -49,6 +49,8 @@ while True:
y -= 30 y -= 30
else: else:
y += 30 y += 30
if x < 0 or x > 630 or y<0 or y>450:
exit()
position.append((x, y)) position.append((x, y))
if ax==x and ay ==y: if ax==x and ay ==y:
ay=30*random.randint(0,15) ay=30*random.randint(0,15)
...@@ -70,4 +72,5 @@ while True: ...@@ -70,4 +72,5 @@ while True:
screen.blit(food, (ax,ay)) screen.blit(food, (ax,ay))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPSCLOCK.tick(10) FPSCLOCK.tick(10)
\ No newline at end of file
\ 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