本文整理匯總了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()