diff --git a/drawing.py b/drawing.py index 728382c..53b0bf6 100644 --- a/drawing.py +++ b/drawing.py @@ -129,7 +129,7 @@ def draw_tv(): rectangle(4, 29) right(5) end_fill() - #circle adornments + #grill adornments fly(-260, -115) fillcolor("#c7b199") begin_fill() @@ -168,16 +168,22 @@ def instructions_text(): instructions_text() -#Checks for clicks inside the roung dials. +#Checks for clicks inside the round dials. Utilizes conditionals to create a button like onbject to "click" on. def detect_circle_click(x_pos, y_pos): - if x_pos > -266.0 and x_pos < -235 and y_pos < -30.0 and y_pos > -95: #These are registering as one button, whhy, it doesnt matter for this use case but I should fix - nextScreen() - elif x_pos > -266.0 and x_pos < -235 and y_pos < -70.0 and y_pos > -99.0: - nextScreen() + top_dial_boundry_top = -30.0 + top_dial_boundry_bottom = -95.0 + left_dial_boundry = -266.0 + right_dial_boundry = -235.0 + bottom_dial_boundry_top = -70.0 + bottom_dial_boundary_bottom = -99.0 + if x_pos > left_dial_boundry and x_pos < right_dial_boundry and y_pos < top_dial_boundry_top and y_pos > top_dial_boundry_bottom : #These are registering as one button, whhy, it doesnt matter for this use case but I should fix + next_screen() + elif x_pos > left_dial_boundry and x_pos < right_dial_boundry and y_pos < bottom_dial_boundry_top and y_pos > bottom_dial_boundary_bottom: + next_screen() onscreenclick(detect_circle_click) #Selects from a random list of colors to change the screen to. -def nextScreen(): +def next_screen(): hideturtle() screen_colors = ['white', 'black', 'red', 'green', 'blue', 'cyan', 'yellow', 'magenta', 'orange', 'purple', 'pink', 'brown', 'grey', 'gold', 'lime', 'teal',