本文整理汇总了Python中screen.Screen.print_titles方法的典型用法代码示例。如果您正苦于以下问题:Python Screen.print_titles方法的具体用法?Python Screen.print_titles怎么用?Python Screen.print_titles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类screen.Screen
的用法示例。
在下文中一共展示了Screen.print_titles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from screen import Screen [as 别名]
# 或者: from screen.Screen import print_titles [as 别名]
class AVE:
def __init__(self, folder="games"):
from screen import Screen
self.screen = Screen()
self.character = Character(self.screen)
self.games = Games(folder, self.screen, self.character)
def start(self):
self.screen.print_titles()
game_to_load = self.screen.menu(self.games.titles(), 8, titles=True)
self.games[game_to_load].load()
again = True
while again:
again = False
try:
self.games[game_to_load].begin()
except AVEGameOver:
next = self.screen.gameover()
self.character.reset()
if next == 0:
again = True
if next == 2:
raise AVEQuit
except AVEWinner:
next = self.screen.winner()
self.character.reset()
if next == 0:
again = True
if next == 2:
raise AVEQuit
except AVEToMenu:
pass
def exit(self):
self.screen.close()