Commit eb5f9fc4 by BellCodeEditor

save project

parent b2ba30a8
Showing with 9 additions and 6 deletions
......@@ -49,11 +49,14 @@ while True:
else:
y-=30
snake_hard = up
if x == apple_x and y == apple_y:
apple_x = random.randint(30,630)
apple_y = random.randint(30,450)
positine.append((x,y))
positine.pop(0)
if x == apple_x and y == apple_y:
a = random.randint(1,22)
b = random.randint(1,16)
apple_x = a*30-30
apple_y = b*30-30
else:
positine.pop(0)
# 将背景图画上去
screen.blit(background, (0, 0))
# 将贪吃蛇画上去
......@@ -66,4 +69,4 @@ while True:
# 刷新画面
pygame.display.update()
# 设置帧数
FPSCLOCK = pygame.time.Clock();FPSCLOCK.tick(4)
\ No newline at end of file
FPSCLOCK = pygame.time.Clock();FPSCLOCK.tick(6)
\ No newline at end of file
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