本文整理汇总了Python中HelperFunctions.appendHighScore方法的典型用法代码示例。如果您正苦于以下问题:Python HelperFunctions.appendHighScore方法的具体用法?Python HelperFunctions.appendHighScore怎么用?Python HelperFunctions.appendHighScore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HelperFunctions
的用法示例。
在下文中一共展示了HelperFunctions.appendHighScore方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import HelperFunctions [as 别名]
# 或者: from HelperFunctions import appendHighScore [as 别名]
#.........这里部分代码省略.........
playerName = playerName[:-1]
showUpdates = True
elif keypress.key == pygame.K_RETURN:
getInput = False
continue
if showUpdates:
screen.fill((0, 0, 0))
text = ourFont.render(playerName, True, (255,
0, 0))
block = text.get_rect()
block.center = (400, 300) # dead center
rect_list.append(screen.blit(text, block))
text = \
ourFont.render('Please type your name, press enter to finish, and backspace to remove characters. '
, True, (255, 255, 255))
block = text.get_rect()
block.center = (400, 250)
# block.center[1] -= 100
rect_list.append(screen.blit(text, block))
pygame.display.update(rect_list)
showUpdates = False
# end while
print 'Final name', playerName
HelperFunctions.appendHighScore(playerScore, playerName)
state = STATE_HIGH_SCORE_TRY_AGAIN
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'