本文整理汇总了Python中HelperFunctions.isNewHighScore方法的典型用法代码示例。如果您正苦于以下问题:Python HelperFunctions.isNewHighScore方法的具体用法?Python HelperFunctions.isNewHighScore怎么用?Python HelperFunctions.isNewHighScore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HelperFunctions
的用法示例。
在下文中一共展示了HelperFunctions.isNewHighScore方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import HelperFunctions [as 别名]
# 或者: from HelperFunctions import isNewHighScore [as 别名]
#.........这里部分代码省略.........
Config.PAGE_TITLE = Config.PAGE_TITLE + ' ' \
+ level_files[state % 9000 - 1]['settings'
]['level_name']
# work out the bonus based on difficulty - will only work for valid difficulties
# try:
exec 'Config.DIFFICULTY_BONUS = Config.DIFFICULTY_BONUS_' \
+ Config.DIFFICULTY.upper()
Config.BACKGROUND = pygame.Surface(screen.get_size())
Config.BACKGROUND = Config.BACKGROUND.convert()
Config.BACKGROUND.fill(Config.BACKGROUND_COLOUR)
Config.screen = \
pygame.display.set_mode(Config.DEFAULT_SCREEN_SIZE)
# print "COLOUR: ", Config.BACKGROUND_COLOUR
# better way of doing it?
# execfile('Snake.py')
G = Game_Module.Game(None)
running = True
while running:
G.update()
if G.gameOver:
playerScore = G.gameScore
del G
running = False
break
if HelperFunctions.isNewHighScore(playerScore):
state = STATE_HIGH_SCORE_INPUT
else:
# state = STATE_EXIT
state = STATE_HIGH_SCORE_TRY_AGAIN
elif state == STATE_HIGH_SCORE_INPUT:
# state = STATE_HIGH_SCORE_TRY_AGAIN
# #### http://www.facebook.com/l.php?u=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F14111381%2Fhow-to-make-pygame-print-input-from-user&h=kAQHS8xjR
(rect_list, state) = high_score_input_menu.update(e,
state)
if False:
pass
getInput = True
showUpdates = True
while getInput:
for keypress in pygame.event.get():
if keypress.type == pygame.KEYDOWN:
if keypress.unicode.isalpha():
playerName += keypress.unicode
showUpdates = True
elif keypress.key == pygame.K_BACKSPACE:
playerName = playerName[:-1]
showUpdates = True
elif keypress.key == pygame.K_RETURN: