Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from cs1graphics import *
- paper = Canvas(300, 200, 'skyBlue', 'My World')
- sun = Circle(30, Point(250,50))
- sun.setFillColor('yellow')
- paper.add(sun)
- facade = Square(60, Point(140,130))
- facade.setFillColor('white')
- paper.add(facade)
- chimney = Rectangle(15, 28, Point(155,85))
- chimney.setFillColor('red')
- chimney.setBorderColor('red')
- paper.add(chimney)
- tree = Polygon(Point(50,80), Point(30,140), Point(70,140))
- tree.setFillColor('darkGreen')
- paper.add(tree)
- smoke = Path(Point(155,70), Point(150,65), Point(160,55), Point(155,50))
- paper.add(smoke)
- sunraySW = Path(Point(225,75), Point(210,90))
- sunraySW.setBorderColor('yellow')
- sunraySW.setBorderWidth(6)
- paper.add(sunraySW)
- sunraySE = Path(Point(275,75), Point(290,90))
- sunraySE.setBorderColor('yellow')
- sunraySE.setBorderWidth(6)
- paper.add(sunraySE)
- sunrayNE = Path(Point(275,25), Point(290,10))
- sunrayNE.setBorderColor('yellow')
- sunrayNE.setBorderWidth(6)
- paper.add(sunrayNE)
- sunrayNW = Path(Point(225,25), Point(210,10))
- sunrayNW.setBorderColor('yellow')
- sunrayNW.setBorderWidth(6)
- paper.add(sunrayNW)
- grass = Rectangle(300, 80, Point(150,160))
- grass.setFillColor('green')
- grass.setBorderColor('green')
- grass.setDepth(75) # must be behind house and tree
- paper.add(grass)
- window = Rectangle(15, 20, Point(130,120))
- paper.add(window)
- window.setFillColor('black')
- window.setBorderColor('red')
- window.setBorderWidth(2)
- window.setDepth(30)
- roof = Polygon(Point(105, 105), Point(175, 105), Point(170,85), Point(110,85))
- roof.setFillColor('darkgray')
- roof.setDepth(30) # in front of facade
- chimney.setDepth(20) # in front of roof
- paper.add(roof)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement