本文整理汇总了Python中core.Core.doInit方法的典型用法代码示例。如果您正苦于以下问题:Python Core.doInit方法的具体用法?Python Core.doInit怎么用?Python Core.doInit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core.Core
的用法示例。
在下文中一共展示了Core.doInit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tuple
# 需要导入模块: from core import Core [as 别名]
# 或者: from core.Core import doInit [as 别名]
from core import Core
from menu import *
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="2D top view zombie shooter game in cramped coridors", epilog="Have fun shooting zombies :)"
)
parser.add_argument("--draw-fps", help="Display FPS counter in upper left corner", action="store_true")
parser.add_argument(
"-r",
"--resolution",
help="The size of game window to use. Please note that the menu backdrop might not display correctly on lower resolutions",
default="1024x768",
)
parser.add_argument("-f", "--fullscreen", help="Run in fullscreen", action="store_true")
args = parser.parse_args()
if "x" in args.resolution:
res = tuple([int(x) for x in args.resolution.split("x")])
else:
print("Warning: Unsupported resolution format defaulting to 1024x768")
res = (1024, 768)
core = Core(res, args.fullscreen, args.draw_fps)
core.doInit()
core.setActiveMode(Menu(core))
core.enterLoop()