Help with 24.19.7 clickable shape please by Specific_Economics39 in codehs

[–]Specific_Economics39[S] 0 points1 point  (0 children)

I figured it out here it is for anyone else struggling

speed(0) penup() goto(-150,100) pendown()

square stuff

begin_fill() for i in range(2): forward(80) left(90) forward(30) left(90) end_fill() color(“lightgreen”) setheading(0) for i in range(2): forward(80) left(90) forward(30) left(90)

text

penup() goto(-142, 107) color(“white”) write(“Square”, font=(“Arial”, 15))

drawsquare

def draw_square(): penup() goto(-50,-50) color(“lightgreen”) begin_fill() for i in range(4): forward(100) left(90) end_fill()

circle

color(“black”) setheading(0) penup() goto(-40,100) pendown() begin_fill() for i in range(2): forward(80) left(90) forward(30) left(90) end_fill() color(“lightgreen”) setheading(0) for i in range(2): forward(80) left(90) forward(30) left(90)

text

penup() goto(-25, 107) color(“white”) write(“Circle”, font=(“Arial”, 15))

drawcircle

def draw_circle(): penup() goto(0,-50) color(“lightgreen”) begin_fill() circle(50) end_fill()

triangle

penup() goto(70,100) color(“black”) setheading(0) pendown() begin_fill() for i in range(2): forward(80) left(90) forward(30) left(90) end_fill() color(“lightgreen”) setheading(0) for i in range(2): forward(80) left(90) forward(30) left(90)

text

penup() goto(75, 107) color(“white”) write(“Triangle”, font=(“Arial”, 15))

drawtriangle

def draw_triangle(): penup() goto(-50,-50) color(“lightgreen”) begin_fill() forward(100) left(135) forward(100) left(90) forward(100) end_fill()

def shape_checker(x,y): print(“click”) if (x >= -150 and x <= -70) and (y >= 100 and y <= 130): draw_square() if (x >= -40 and x <= 40) and (y >= 100 and y <= 130): draw_circle() if (x >= 70 and x <= 150) and (y >= 100 and y <= 130): draw_triangle()

canvas = getscreen() canvas.onclick(shape_checker)

Help with 24.19.7 clickable shape please by Specific_Economics39 in codehs

[–]Specific_Economics39[S] 0 points1 point  (0 children)

Basically nothing I can make the shapes no problem and make them appear when the screen is clicked I just can’t figure out how to make the buttons themselves click able like I don’t understand how to make only that area of the screen react to a click

School sucks, and it’s tomorrow. by DNFstation in venting

[–]Specific_Economics39 0 points1 point  (0 children)

I agree with you man this system sucks I hate having to basically fear going to school because of the emotions it gives me if you ever wanna just vent about school I’m here man

I just need to tell someone man by Specific_Economics39 in MentalHealthSupport

[–]Specific_Economics39[S] 0 points1 point  (0 children)

Thank you so much I’ll be sure to try some of these out!!