Commit 0d55d109 by BellCodeEditor

auto save

parent 500556f7
Showing with 3 additions and 2 deletions
...@@ -24,7 +24,7 @@ position = [(180, 90), (180, 120), (210, 120), (x, y)] ...@@ -24,7 +24,7 @@ position = [(180, 90), (180, 120), (210, 120), (x, y)]
setheading = "right" setheading = "right"
snake_head = right snake_head = right
fx=randint(0,20)*30 fx=randint(0,20)*30
fy=randint(0,16)*30 fy=randint(0,15)*30
print(fx,fy) print(fx,fy)
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
...@@ -58,7 +58,8 @@ while True: ...@@ -58,7 +58,8 @@ while True:
position.pop(0) position.pop(0)
if position[-1] == (fx,fy): if position[-1] == (fx,fy):
fx=randint(0,20)*30 fx=randint(0,20)*30
fy=randint(0,16)*30 fy=randint(0,15)*30
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