Commit 381b003f by BellCodeEditor

save project

parent 95ca8934
Showing with 9 additions and 1 deletions
......@@ -53,6 +53,13 @@ while True:
else:
y+=30
snake.append((x,y))
for i in range(len(snake)-1):
if snake[-1] == snake[i]:
exit()
if x<0 or x>630 or y<0 or y>450:
exit()
if x==ap1 and y==ap2:
ap1=(random.randint(0,21))*30
ap2=(random.randint(0,15))*30
......@@ -78,6 +85,6 @@ while True:
# 刷新画面
pygame.display.update()
FPS.tick(5)
FPS.tick(6)
\ 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