本文整理汇总了Python中Tree.tree方法的典型用法代码示例。如果您正苦于以下问题:Python Tree.tree方法的具体用法?Python Tree.tree怎么用?Python Tree.tree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tree
的用法示例。
在下文中一共展示了Tree.tree方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: background
# 需要导入模块: import Tree [as 别名]
# 或者: from Tree import tree [as 别名]
def background():
"""Creates the general background scenery"""
#Creates random clouds in the sky
for r in range(0,cloudNum):
#Initialize variables
x = randint(-100,1200)
y = randint(-20,100)
width = randint(60,90)
height = randint(20,50)
cloudColor = choice(["gray92","gray95","gray98"])
#Create lots of ovals to represent clouds
for i in range(0,20):
x1 = x - randint(1, width)
y1 = y - randint(1, height)
x2 = x + randint(1, width)
y2 = y + randint(1, height)
oval = screen.create_oval(x1, y1, x2, y2, fill=cloudColor, outline=cloudColor)
#Ground behind the trees
screen.create_oval(-100,320,1100,600, fill ="gainsboro", outline ="gainsboro")
#Trees from Tree.py
Tree.tree(screen)
#Snowy Ground
screen.create_rectangle (0,500,1000,800,fill="snow",outline="snow")
screen.create_polygon (0,500,50,500,100,450,250,470,400,430,500,450,650,420,700,450,800,460,1020,470,1000,600, fill="snow",outline="snow",smooth="true")
#Scorebox
screen.create_rectangle( 320,100,680,350, fill="#80d5ff", outline="white", width="8")