Commit cd787fef by BellCodeEditor

save project

parent cd9d88ea
Showing with 3 additions and 2 deletions
......@@ -58,6 +58,7 @@ while True:
y += 30
position.append((x, y))
if x == apple_x and y == apple_y:
score+=10
num1 = random.randint(0,21)
num2 = random.randint(0,15)
apple_x = num1*30
......@@ -67,8 +68,8 @@ while True:
# 将背景图画上去
screen.blit(background, (0, 0))
# 将贪吃蛇的头画上去
if x < 0 of x > 630
if x < 0 of x > 630 of y < 0 or y > 450:
exit
screen.blit(snake_head, position[-1])
# 将贪吃蛇的身体画上去
for i in range(len(position)-1):
......
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