本文整理汇总了Python中hud.Hud.start_end_screen方法的典型用法代码示例。如果您正苦于以下问题:Python Hud.start_end_screen方法的具体用法?Python Hud.start_end_screen怎么用?Python Hud.start_end_screen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hud.Hud
的用法示例。
在下文中一共展示了Hud.start_end_screen方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: from hud import Hud [as 别名]
# 或者: from hud.Hud import start_end_screen [as 别名]
#.........这里部分代码省略.........
self.hud.end_info()
self.state = MonorailGame.STATE_BEGIN
self.music_man.play()
elif self.state == MonorailGame.STATE_BEGIN:
if self.begin_timeout % 50 == 0:
random_spawn = not self.game_data.is_single_player();
spawns_left = self.playfield.spawn_next_goldcar( random_spawn )
if spawns_left:
self.begin_timeout += 50
self.controller.game_tick( indev )
self.playfield.game_tick()
# Start right away in single player
if self.game_data.is_single_player():
self.scenario.game_tick()
self.begin_timeout -= 1
if self.begin_timeout <= 0:
self.state = MonorailGame.STATE_GAME
if indev.mouse.has_moved():
self.mouse_timeout = MonorailGame.MOUSE_TIMEOUT
else:
self.mouse_timeout -= 1
elif self.state == MonorailGame.STATE_GAME:
self.controller.game_tick( indev )
self.playfield.game_tick()
self.scenario.game_tick()
if self.scenario.is_finished():
if not self.game_data.is_single_player():
self.hud.start_end_screen()
else:
self.game_data.get_quest().save_score( self.scenario )
skill = self.game_data.get_quest().get_skill( self.scenario )
self.game_data.skill_level.update( skill )
self.game_data.save_single_player_progress()
if self.scenario.has_won():
self.hud.start_win_screen()
else:
self.hud.start_lose_screen()
self.state = MonorailGame.STATE_STATS
self.mouse_timeout = MonorailGame.MOUSE_TIMEOUT
self.music_man.stop()
if indev.mouse.has_moved():
self.mouse_timeout = MonorailGame.MOUSE_TIMEOUT
else:
self.mouse_timeout -= 1
elif self.state == MonorailGame.STATE_STATS:
if self.hud.is_ready():
if not self.game_data.is_single_player():
self.game_data.add_total_scores( self.playfield )
self.hud.start_total_screen()
self.state = MonorailGame.STATE_TOTAL
else:
if self.scenario.has_won():
self.state = MonorailGame.STATE_DONE
else:
self.restart( self.game_data )