本文整理汇总了Python中constants.Constants.initColours方法的典型用法代码示例。如果您正苦于以下问题:Python Constants.initColours方法的具体用法?Python Constants.initColours怎么用?Python Constants.initColours使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类constants.Constants
的用法示例。
在下文中一共展示了Constants.initColours方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from constants import Constants [as 别名]
# 或者: from constants.Constants import initColours [as 别名]
def main(stdscr):
"""Initialises the Game object and basically gets out of the way"""
# Make sure the screen is big enough for our amazing game
(ywidth, xwidth) = stdscr.getmaxyx()
if (ywidth < Constants.YRES or xwidth < Constants.XRES):
stdscr.addstr("The terminal should be at least {} by {}".format(Constants.XRES, Constants.YRES))
stdscr.getch()
return -1
# Set-up the colours we'll be using'
curses.start_color()
curses.init_pair(1, curses.COLOR_RED, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_YELLOW, curses.COLOR_BLACK)
curses.init_pair(3, curses.COLOR_GREEN, curses.COLOR_BLACK)
curses.init_pair(5, curses.COLOR_BLUE, curses.COLOR_BLACK)
Constants.initColours()
# Make the window..
win = curses.newwin(Constants.YRES, Constants.XRES)
win.bkgd(' ', curses.color_pair(0))
# Start the game, with the title screen.
title = TitleScreen(win)
title.execute()