I am having trouble trying to clone a tree i made. Any suggestions?
My Input:
Error:
My Input:
Code:
from cs1graphics import * paper = Canvas(300, 200, 'skyBlue', 'My Forest') grass = Rectangle(300, 80, Point(150,160)) grass.setFillColor('green') grass.setBorderColor('green') grass.setDepth(75) paper.add(grass) tree1 = ('tree', 'tree_bottom', 'tree_base') tree = Polygon(Point(50,80), Point(30,125), Point(70,125)) tree.setFillColor('darkGreen') paper.add(tree) tree_bottom = Polygon(Point(50,80), Point(30,150), Point(70,150)) tree_bottom.setFillColor('darkGreen') paper.add(tree_bottom) tree_base = Polygon(Point(50,150), Point(45,165), Point(55,165)) tree_base.setFillColor('brown') paper.add(tree_base) tree2 = tree1.clone() tree2.move(170,30) tree2.scale(1.2) paper.add(tree2)
Code:
Traceback (most recent call last): File "C:/Users/Robert/Documents/CSIS Projects/Ex3_8.py", line 30, in <module> tree2 = tree1.clone() AttributeError: 'tuple' object has no attribute 'clone'
Comment