Commit 8f301aa3 by BellCodeEditor

save project

parent ccbea75d
Showing with 8 additions and 4 deletions
......@@ -61,9 +61,13 @@ while True:
num2=random.randint(0,15)
apple_x=num1*30
apple_y=num2*30
a+=10
a+=100
else:
position.pop(0)
if x>630 or x<0 or y>450 or y<0:
exit()
if position[-1] in position[:-1]:
exit()
# 将背景图画上去
screen.blit(background, (0, 0))
# 将贪吃蛇的头画上去
......@@ -73,9 +77,9 @@ while True:
screen.blit(body, position[i])
text='Score'+str(a)
b=my_font.render(text,True,(0,0,0))
screen.blit(b, (560,0))
screen.blit(b, (0,0))
# 将果实画上去
screen.blit(food, (apple_x, apple_y))
# 刷新画面
pygame.display.update()
FPSCLOCK.tick(3)
\ No newline at end of file
FPSCLOCK.tick(9)
\ 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