Commit c5afa954 by BellCodeEditor

save project

parent e074a5af
Showing with 5 additions and 2 deletions
......@@ -41,6 +41,7 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero3.png'),
pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')]
my_font=pygame.font.Font('STKAITI.TTF',30)
index = 0
y = 400
jumpState = "runing"
......@@ -99,7 +100,9 @@ while True:
screen.blit(road, (road_x, 500)) # 道路
screen.blit(wukong.image, (150, y)) # 悟空
player_score='Score:'
info=my_font.render(player_score+str(score),True,(255,255,255))
screen.blit(info,(900,50))
time += 1
if time >= 60: # 创建障碍物精灵
time = 0
......@@ -120,7 +123,7 @@ while True:
if sprite.rect.x+sprite.rect.width<wukong.rect.x:
score+=sprite.score
sprite.score=0
print(str(score))
# 刷新画面
pygame.display.update()
......
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