Commit a1cc1ec2 by BellCodeEditor

save project

parent 55e981ef
Showing with 2 additions and 2 deletions
...@@ -26,8 +26,6 @@ position = [(180, 90), (180, 120), (210, 120), (x, y)] ...@@ -26,8 +26,6 @@ position = [(180, 90), (180, 120), (210, 120), (x, y)]
setheading = "right" setheading = "right"
snake_head = right snake_head = right
score=0 score=0
if x<0 or x>630 or y<0 or y>450:
exit()
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
...@@ -64,6 +62,8 @@ while True: ...@@ -64,6 +62,8 @@ while True:
apple_y=30*m-30 apple_y=30*m-30
else: else:
position.pop(0) position.pop(0)
if x<0 or x>630 or y<0 or y>450:
exit()
position.append((x, y)) position.append((x, y))
# 将背景图画上去 # 将背景图画上去
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
......
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