当前位置: 首页>>代码示例>>Python>>正文


Python HelperFunctions.getHighScores方法代码示例

本文整理汇总了Python中HelperFunctions.getHighScores方法的典型用法代码示例。如果您正苦于以下问题:Python HelperFunctions.getHighScores方法的具体用法?Python HelperFunctions.getHighScores怎么用?Python HelperFunctions.getHighScores使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HelperFunctions的用法示例。


在下文中一共展示了HelperFunctions.getHighScores方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: import HelperFunctions [as 别名]
# 或者: from HelperFunctions import getHighScores [as 别名]

#.........这里部分代码省略.........

            elif state == STATE_LEVEL_CREATOR:
                screen.fill((0, 0, 0))

                rect_list.append(HelperFunctions.makeTextRect(
                    'Please follow the instructions in the console.',
                    (255, 255, 255),
                    (400, 250),
                    screen,
                    ourFont,
                    True,
                    ))

                rect_list.append(HelperFunctions.makeTextRect(
                    'Once complete, please restart the menu. ',
                    (255, 255, 255),
                    (400, 300),
                    screen,
                    ourFont,
                    True,
                    ))

                pygame.display.update(rect_list)

                os.system(sys.executable + ' level_creator.py')

                state = STATE_EXIT
            elif state == STATE_HIGH_SCORES:

                # print 'High Scores'

                (rect_list, state) = high_scores_menu.update(e, state)

                highScoresList = HelperFunctions.getHighScores()

                yOffset = 220

                screen.fill((0, 0, 0))

                rect_list.append(HelperFunctions.makeTextRect('Rank',
                                 GREEN, (100, yOffset), screen,
                                 ourFont))
                rect_list.append(HelperFunctions.makeTextRect('Name',
                                 GREEN, (200, yOffset), screen,
                                 ourFont))
                rect_list.append(HelperFunctions.makeTextRect('Score',
                                 GREEN, (450, yOffset), screen,
                                 ourFont))

                yOffset += 30

                colour = dict()
                colour['normal'] = (255, 255, 255)
                colour['bronze'] = (128, 64, 0)
                colour['silver'] = (192, 192, 192)
                colour['gold'] = (232, 232, 0)

                for (idx, tup) in enumerate(highScoresList):

                    # print idx

                    if idx == 0:
                        c = colour['gold']
                    elif idx == 1:
                        c = colour['silver']
                    elif idx == 2:
开发者ID:jamietanna,项目名称:PySnake,代码行数:70,代码来源:PySnakeMenu.py


注:本文中的HelperFunctions.getHighScores方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。