如何在pygame中创建高分函数

时间:2016-11-29 18:37:07

标签: python-3.x pygame

我在pygame中创建乐谱功能时遇到了麻烦,这是我想出来的,但它似乎并没有起作用。

    def highest_things_dodged(ns, hs):
       font = pygame.font.SysFont('comicsansms', 25)
       score = font.render("Highscore: "+str(hs), True, black)
       while True:
         if ns > hs:
          hs+ns
          gameDisplay.blit(scr,(50,0))

如果有人知道如何解决问题请评论 感谢

1 个答案:

答案 0 :(得分:0)

我不确定你想做什么,但这是一个简单的例子:

if score > highscore:
    highscore = score