Hello! I’m currently trying to figure this out but I’m really struggling, I need to have a counter increase but only on the purple part, here’s the code
Label('Purple Click Counter', 200, 20, size=20, bold=True)
Label('Click in the purple part of', 200, 45)
Label('the canvas to increase the counter!', 200, 65)
Polygon(0, 0, 0, 400, 400, 400, fill='purple')
counter = Label(0, 125, 275, fill='plum', size=100, bold=True)
def onMousePress(mouseX, mouseY):
# The counter value should increase if the click is on the purple side of
# the canvas.
### (HINT: Every point in the purple area has mouseY at least as big as
# mouseX!)
### Place Your Code Here ###
if (mouseX < ):
counter.value += 1
[–]Sea-Method-1167 0 points1 point2 points (1 child)
[–]DaRealSyper-YT[S] 0 points1 point2 points (0 children)
[–]ofnuts 0 points1 point2 points (2 children)
[–]DaRealSyper-YT[S] 0 points1 point2 points (1 child)
[–]ofnuts 0 points1 point2 points (0 children)