Commit 70ad15ed by BellCodeEditor

auto save

parent 85e005d6
Showing with 4 additions and 4 deletions
...@@ -30,7 +30,7 @@ setheading = "right" ...@@ -30,7 +30,7 @@ setheading = "right"
snake_head = right snake_head = right
while True: while True:
a=random.randint(2,5) a=random.randint(1,10)
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
...@@ -75,11 +75,11 @@ while True: ...@@ -75,11 +75,11 @@ while True:
if position[-1] in position[:-1]: if position[-1] in position[:-1]:
print('您撞到了自己') print('您撞到了自己')
exit() exit()
if score>100:
print('你赢了')
exit()
# if (apple_x,apple_y) in position[:len[position]-2]:
# apple_x=(random.randint(0,630))//30*30
# apple_y=(random.randint(0,450))//30*30
# 将背景图画上去 # 将背景图画上去
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