本文整理汇总了Python中Game.Game.pause方法的典型用法代码示例。如果您正苦于以下问题:Python Game.pause方法的具体用法?Python Game.pause怎么用?Python Game.pause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Game.Game
的用法示例。
在下文中一共展示了Game.pause方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Main
# 需要导入模块: from Game import Game [as 别名]
# 或者: from Game.Game import pause [as 别名]
def Main(stdscr):
args = Arguments(sys.argv)
mineFieldWidth, mineFieldHeight, numMines, mode = args.parse()
game = Game(stdscr, mineFieldWidth, mineFieldHeight, numMines)
game.start()
while True:
event = stdscr.getch()
my, mx = 0, 0
if event == curses.KEY_MOUSE:
_, mx, my, _, bstate = curses.getmouse()
if bstate & curses.BUTTON1_PRESSED :
if game.poke(my, mx) == "dead":
game.gameLose()
elif bstate & curses.BUTTON3_PRESSED:
game.flag(my, mx)
maxy, maxx = stdscr.getmaxyx()
if game.checkWin():
game.gameWin()
if event == ord("q") or (mx >= maxx - 9 and mx <= maxx - 4 and my == maxy - 2):
game.exit()
if event == ord("R") or (mx >= 39 and mx <= 47 and my == maxy - 2):
game.displayRecord()
if event == ord("c") or (mx >= 14 and mx <= 21 and my == maxy - 2):
game.resume()
if event == ord("p") or (mx >= 3 and mx <= 9 and my == maxy - 2):
game.pause()
if event == ord("r") or (mx >= 26 and mx <= 34 and my == maxy - 2):
game.restart()