Commit a5f1dceb by BellCodeEditor

save project

parent 1a8a332c
Showing with 6 additions and 5 deletions
...@@ -57,9 +57,10 @@ while True: ...@@ -57,9 +57,10 @@ while True:
if x==w and y==c: if x==w and y==c:
n1=random.randint(1,22) n1=random.randint(1,22)
n2=random.randint(1,16) n2=random.randint(1,16)
w=n2*30-30 w=n1*30-30
c=n1*30-30 c=n2*30-30
position.pop(0) else:
position.pop(0)
# 将背景图画上去 # 将背景图画上去
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
# 将贪吃蛇的头画上去 # 将贪吃蛇的头画上去
...@@ -72,4 +73,4 @@ while True: ...@@ -72,4 +73,4 @@ while True:
screen.blit(food, (w,c)) screen.blit(food, (w,c))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPSCLOCK.tick(8) FPSCLOCK.tick(3)
\ No newline at end of file \ 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