本文整理汇总了Python中theme.Theme.load_data方法的典型用法代码示例。如果您正苦于以下问题:Python Theme.load_data方法的具体用法?Python Theme.load_data怎么用?Python Theme.load_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类theme.Theme
的用法示例。
在下文中一共展示了Theme.load_data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from theme import Theme [as 别名]
# 或者: from theme.Theme import load_data [as 别名]
def main():
global screen
print("Nerd Tabu")
# Parse command line
parser = argparse.ArgumentParser()
parser.add_argument('quizfile', type=argparse.FileType('r'), help='Name of the quiz file')
parser.add_argument('teamA', nargs='?', metavar='teamname_A', default='Team A', help='Name of team A')
parser.add_argument('teamB', nargs='?', metavar='teamname_B', default='Team B', help='Name of team B')
parser.add_argument('-d', '--datadir', default='.', help='Resource directory')
parser.add_argument('-f', '--fullscreen', help='Run fullscreen', action='store_true')
args = parser.parse_args()
# Update settings
settings = Settings(args.quizfile, args.datadir)
settings.teams = [ args.teamA, args.teamB ]
theme = Theme(args.datadir)
# Initial game data
cards = settings.get_random_cards()
current_team = 0
# Main game loop
pygame.init()
if args.fullscreen:
# screen = pygame.display.set_mode(theme.screen_size, pygame.FULLSCREEN)
screen = pygame.display.set_mode(theme.screen_size, pygame.RESIZABLE | pygame.NOFRAME)
else:
screen = pygame.display.set_mode(theme.screen_size)
theme.load_data()
while len(cards)>0:
team_get_ready(theme, settings, current_team)
play_round(theme, settings, current_team, cards)
current_team = (current_team + 1) % len(settings.teams)
show_final_scores(theme, settings)
pygame.quit()