Question: Python: Elaborate the scene program above so it becomes changeScene.py, and changes one or more times when you click the mouse (and use win.getMouse()). You

Python:

Elaborate the scene program above so it becomes changeScene.py, and changes one or more times when you click the mouse (and use win.getMouse()). You may use the position of the mouse click to affect the result, or it may just indicate you are ready to go on to the next view.

from graphics import *

def main(): win = GraphWin('beautiful senory', 1500, 1400) # give title and dimensions

head = Circle(Point(1070,100), 50) # set center and radius head.setFill("orange") head.draw(win) shape = Rectangle(Point(700,700), Point(300,300)) shape.setOutline("red") shape.setFill("Gray") shape.draw(win) shape = Rectangle(Point(200,350), Point(800,200)) shape.setOutline("red") shape.setFill("Dim Gray") shape.draw(win) shape = Rectangle(Point(400,650), Point(600,400)) shape.setOutline("black") shape.setFill("white") shape.draw(win) shape1 = Rectangle(Point(900,220), Point(950,1000)) shape1.setOutline("cyan") shape1.setFill("brown") shape1.draw(win) shape1 = Rectangle(Point(1000,400), Point(1050,1100)) shape1.setOutline("cyan") shape1.setFill("brown") shape1.draw(win) head = Circle(Point(1050,400), 100) # set center and radius head.setFill("green") head.draw(win) shape1 = Rectangle(Point(1050,300), Point(1100,1150)) shape1.setOutline("cyan") shape1.setFill("brown") shape1.draw(win)

shape1 = Rectangle(Point(1150,220), Point(1200,1250)) shape1.setOutline("cyan") shape1.setFill("brown") shape1.draw(win) head = Circle(Point(900,230), 100) # set center and radius head.setFill("green") head.draw(win) head = Circle(Point(1100,300), 100) # set center and radius head.setFill("green") head.draw(win) head = Circle(Point(1200,230), 100) # set center and radius head.setFill("green") head.draw(win)

mouth = Oval(Point(30, 150), Point(250, 250)) # set corners of bounding box mouth.setFill("Cornflower Blue") mouth.draw(win) mouth = Oval(Point(240, 100), Point(400, 150)) # set corners of bounding box mouth.setFill("Cornflower Blue") mouth.draw(win) mouth = Oval(Point(500, 100), Point(650, 170)) # set corners of bounding box mouth.setFill("Cornflower Blue") mouth.draw(win) mouth = Oval(Point(650, 40), Point(750, 80)) # set corners of bounding box mouth.setFill("Cornflower Blue") mouth.draw(win)

win.getMouse() win.close()

main()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!