Commit da29a846 by BellCodeEditor

save project

parent 49217b03
Showing with 7 additions and 1 deletions
......@@ -8,7 +8,8 @@ pygame.init()
# 创建一个窗口
screen = pygame.display.set_mode((660, 480))
setheading="right"
my_font=pygame.font.Font("neuropol.ttf",30)
score=0
# 背景
background = pygame.image.load('bg.png')
......@@ -65,6 +66,7 @@ while True:
num2=random.randint(0,15)
apple_x=num1*30
apple_y=num2*30
score+=10
else:
position.pop(0)
......@@ -82,6 +84,10 @@ while True:
# screen.blit(body, (180, 90))
# 将果实画上去
screen.blit(food, (apple_x, apple_y))
# 渲染文字
info="score"+str(score)
text=my_font.render(info,True,(0,0,0))
screen.blit(text,(400,10))
# 设置帧数
FPSCLOCK.tick(3)
......
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