Answered step by step
Verified Expert Solution
Question
1 Approved Answer
app.background = gradient ( rgb ( 0 , 3 0 , 0 ) , 'darkGreen', start = 'bottom' ) # draw the flytrap and its
app.background gradientrgb 'darkGreen', start'bottom'
# draw the flytrap and its flowerpot
Polygon
fillgradientdarkRed 'fireBrick', start'left'
Oval fill'sienna', border'darkRed', borderWidth
Oval fillgradientlimeGreen 'mediumSeaGreen', start'left'
rotateAngle
Oval fill'saddleBrown'
Oval fill'sienna'
flytrap Oval fillgradientcrimson 'salmon'
border'limeGreen', borderWidth rotateAngle
flytrap Oval fillgradientcrimson 'salmon'
border'limeGreen', borderWidth rotateAngle
# fly
flyWings Oval fill'darkGray'
fly Oval
fly.isEaten False
def closeFlytrap:
# This traps the fly.
flytrapwidth
flytrapcenterX
flytrapfill gradientmediumSeaGreen 'limeGreen'
flytrapwidth
flytrapcenterX
flytrapfill gradientmediumSeaGreen 'limeGreen'
flyWings.visible False
fly.visible False
fly.isEaten True
def onMouseMovemouseX mouseY:
# The fly should only be moved to the mouse if it hasn't already been eaten.
### Fix Your Code Here ###
flyWings.centerX mouseX
flyWings.centerY mouseY
fly.centerX mouseX
fly.centerY mouseY
# The flytrap should eat the fly whenever the fly flies into its mouth.
### Place Your Code Here ###
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started