Commit f60346e1 by BellCodeEditor

auto save

parent 1eedcf54
Showing with 7 additions and 4 deletions
......@@ -54,9 +54,12 @@ while True:
y += 30
position.append((x, y))
if x==ax and y ==ay:
ax = random.randint(0,660)
ay = random.randint(0,480)
position.pop(0)
num1 = random.randint(0,21)
ax = num1*30
num2 = random.randint(0,15)
ay = num2*30
else:
position.pop(0)
# 将背景图画上去
......@@ -71,4 +74,4 @@ while True:
screen.blit(food, (ax, ay))
# 刷新画面
pygame.display.update()
FPSCLOCK.tick(3)
FPSCLOCK.tick(4)
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