Commit 4ed611a4 by BellCodeEditor

save project

parent 367886fc
Showing with 4 additions and 2 deletions
...@@ -58,6 +58,8 @@ while True: ...@@ -58,6 +58,8 @@ while True:
apple_y = num2 * 30 - 30 apple_y = num2 * 30 - 30
else: else:
position.pop(0) position.pop(0)
if x < 0 or x > 630 or y < 0 or y > 450:
exit()
screen.blit(background,(0,0)) screen.blit(background,(0,0))
screen.blit(right, position[-1]) screen.blit(right, position[-1])
screen.blit(food,(apple_x,apple_y)) screen.blit(food,(apple_x,apple_y))
...@@ -67,4 +69,4 @@ while True: ...@@ -67,4 +69,4 @@ while True:
for i in range(len(position)-1): for i in range(len(position)-1):
screen.blit(body,position[i]) screen.blit(body,position[i])
pygame.display.update() pygame.display.update()
FPSCLOCK.tick(7) FPSCLOCK.tick(5)
\ 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