Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
app.background = 'dimGray' Line ( 2 0 0 , 0 , 2 0 0 , 4 0 0 , fill = 'linen', lineWidth = 4
app.background 'dimGray' Line fill'linen', lineWidth opacity dashes # frozen yogurt machine Rect fill'silver' Rect fillgradientlightSkyBlue 'white', start'top' Rect fillgradientpink 'peachpuff', start'top' Rect fillgradientperu 'wheat', start'top' Rect Rect fill'darkGray' Rect fill'white' # handles handle Line fill'white', lineWidth handle Line fill'white', lineWidth handle Line fill'white', lineWidth Circle fill'white' Circle fill'white' Circle fill'white' # frozen yogurt flow Line lineWidth visibleFalse, fillgradientlightSkyBlue 'white', start'left' flow Line lineWidth visibleFalse, fillgradientpink 'peachpuff', start'left' flow Line lineWidth visibleFalse, fillgradientperu 'wheat', start'left' cup Polygon fill'crimson' def pressHandlehandle flow: handle.visible False flow.visible True cup.centerX flow.centerX cup.top flow.bottom def onMousePressmouseX mouseY: # Reposition the cup to catch the yogurt flow if a handle is pressed! ### HINT: Use a helper function we defined above. What arguments should # you pass into the function? ### Place Your Code Here ### pass def onMouseReleasemouseX mouseY: # This resets the machine and the cup. handlevisible True handlevisible True handlevisible True flowvisible False flowvisible False flowvisible False cup.centerX cup.bottom
app.background 'dimGray'
Line fill'linen', lineWidth opacity dashes
# frozen yogurt machine
Rect fill'silver'
Rect fillgradientlightSkyBlue 'white', start'top'
Rect fillgradientpink 'peachpuff', start'top'
Rect fillgradientperu 'wheat', start'top'
Rect
Rect fill'darkGray'
Rect fill'white'
# handles
handle Line fill'white', lineWidth
handle Line fill'white', lineWidth
handle Line fill'white', lineWidth
Circle fill'white'
Circle fill'white'
Circle fill'white'
# frozen yogurt
flow Line lineWidth visibleFalse,
fillgradientlightSkyBlue 'white', start'left'
flow Line lineWidth visibleFalse,
fillgradientpink 'peachpuff', start'left'
flow Line lineWidth visibleFalse,
fillgradientperu 'wheat', start'left'
cup Polygon fill'crimson'
def pressHandlehandle flow:
handle.visible False
flow.visible True
cup.centerX flow.centerX
cup.top flow.bottom
def onMousePressmouseX mouseY:
# Reposition the cup to catch the yogurt flow if a handle is pressed!
### HINT: Use a helper function we defined above. What arguments should
# you pass into the function?
### Place Your Code Here ###
pass
def onMouseReleasemouseX mouseY:
# This resets the machine and the cup.
handlevisible True
handlevisible True
handlevisible True
flowvisible False
flowvisible False
flowvisible False
cup.centerX
cup.bottom
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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