本文整理汇总了Python中Graphics.init方法的典型用法代码示例。如果您正苦于以下问题:Python Graphics.init方法的具体用法?Python Graphics.init怎么用?Python Graphics.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graphics
的用法示例。
在下文中一共展示了Graphics.init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: import Graphics [as 别名]
# 或者: from Graphics import init [as 别名]
import Graphics, Core
import sys, imp
if __name__ == '__main__':
ai_paths = sys.argv[1:]
ai_list = []
colors = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']
alignment_counter = 0
for i in ai_paths:
if i != 'null':
ai_module = imp.load_source('ShouldntMatter', i)
ai_list.append(
Core.AI(ai_module.decision, i, colors[alignment_counter]))
alignment_counter += 1
Graphics.init(sys.argv, ai_list)
示例2: main
# 需要导入模块: import Graphics [as 别名]
# 或者: from Graphics import init [as 别名]
# Import a library of functions called 'pygame'
import sys
import pygame
import Graphics
import Input
import Sprites.Map
# Initialize the game engine
screen_width = 480
screen_height = 320
Graphics.init(screen_width, screen_height)
Input.init()
map = Sprites.Map.Map(Graphics, 1)
def main():
# Loop until the user clicks the close button.
done = False
loopCount = 0
while not done:
loopCount += 1
Input.update()
if(Input.Trigger(Input.Close)):
done = True
map.update()
Graphics.update()
if __name__ == "__main__":
main()
# Close window and exit