Commit ee02cf7b by BellCodeEditor

save project

parent 8bc82c62
Showing with 4 additions and 4 deletions
...@@ -52,8 +52,8 @@ while True: ...@@ -52,8 +52,8 @@ while True:
y -= 30 y -= 30
else: else:
y += 30 y += 30
if (x>630 or x<0 or y>450 or y<0) or ((x,y)in st): if (x>630 or x<0 or y>450 or y<0) or ((x,y)in position):
exit()
position.append((x, y)) position.append((x, y))
if x==apple_x and y==apple_y: if x==apple_x and y==apple_y:
num1=random.randint(1,22) num1=random.randint(1,22)
...@@ -78,4 +78,4 @@ while True: ...@@ -78,4 +78,4 @@ while True:
screen.blit(food, (apple_x,apple_y )) screen.blit(food, (apple_x,apple_y ))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPSCLOCK.tick(10) FPSCLOCK.tick(3)
\ 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