Commit 3419dfb7 by BellCodeEditor

save project

parent 26f91661
Showing with 5 additions and 4 deletions
......@@ -106,7 +106,7 @@ while True:
block_list.add(obstacle)
for sprite in block_list: # 遍历、展示障碍物精灵
sprite.rect.x -= 8 #障碍物精灵向左移动(x坐标减小)
screen.blit(sprite.image, (sprite.rect.x, sprite.rect.y)) 渲染障碍物
screen.blit(sprite.image, (sprite.rect.x, sprite.rect.y)) #渲染障碍物
if sprite.rect.x <= 0-sprite.rect.width:
sprite.kill()#删除精灵
if pygame.sprite.collide_rect(wukong, sprite): # 精灵碰撞检测
......@@ -118,8 +118,8 @@ while True:
score += sprite.score
sprite.score = 0
# 刷新画面
myfont = pygame.Font.font("STKAITI.TTF",30)
info1 = myfont.render("分数:",True,(0,0,0))
screen.blit(info1,(900,0))
myfont = pygame.font.Font('STKAITI.TTF',15)#设置字体
info1 = myfont.render("分数:"+str(score),True,(0,0,0))
screen.blit(info1,(850,0))
pygame.display.update()
FPS.tick(60)
\ 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