Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Rect ( 1 6 5 , 9 0 , 7 0 , 4 0 , fill = 'saddleBrown' ) # hidden spill spill = Polygon

Rect(165,90,70,40, fill='saddleBrown')
# hidden spill
spill = Polygon(165,0,165,165,102,305,298,305,235,165,235,0,
fill=rgb(170,170,220), visible=False)
# liquid
liquid = Polygon(104,305,296,305,235,170,165,170, fill=rgb(170,170,220))
liquid.pressure =0
# bubbles
Circle(220,230,20, fill='white', opacity=10)
Circle(190,260,10, fill='white', opacity=10)
def onMousePress(mouseX, mouseY):
# Move the liquid's bottom up or down by 5 pixels, based on its current
# position.
### Place Your Code Here ###
# Every mouse press, the pressure should increase. When it gets to 10,
# the liquid should explode out of the flask.
### (HINT: We defined a custom property and spill variable above that
# might be helpful.)
### Place Your Code Here ###
pass

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions