本文整理匯總了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()