Created / clarified more comments

This commit is contained in:
Louis Cooper 2023-07-23 19:04:41 -04:00
parent 432d4bf74c
commit d193355daf
1 changed files with 19 additions and 16 deletions

View File

@ -8,14 +8,16 @@ from http.client import RemoteDisconnected
from turtle import *
import random
pensize(2)
pensize(2) #Sets line width for drawing.
def fly(x, y): #Utlizes x, y positions to move the turtle
#Utlizes x, y positions to move the turtle
def fly(x, y):
penup()
goto(x, y)
pendown()
def starting_position(): #sets initial position of the drawing. See fly()
#sets initial position of the drawing. See fly()
def starting_position():
penup()
fly(-600, -300)
pendown()
@ -36,6 +38,7 @@ def rectangle(length, height, corner_radius=0):
else:
left(90)
#Draws a black background
def draw_background():
speed(0)
fillcolor("black")
@ -53,33 +56,31 @@ def draw_tv():
begin_fill()
rectangle(300, 210, 10)
end_fill()
# Antenna - added
#Antenna
color("#C0C0C0")
pensize(5)
penup()
goto(-350, 10) # Positioning the antenna
goto(-350, 10)
pendown()
setheading(30) # Angle for the left part of the antenna
setheading(30)
forward(100)
penup()
goto(-350, 10) # Going back to the antenna's root
goto(-350, 10)
pendown()
setheading(150) # Angle for the right part of the antenna
setheading(150)
forward(100)
pensize(2)
setheading(0) # Resetting the direction
# Antenna Base - added
setheading(0)
#Antenna Base
penup()
goto(-360, 0) # Positioning the base
goto(-360, 0)
pendown()
fillcolor('#C0C0C0')
begin_fill()
circle(10)
end_fill()
color("black")
# Antenna Base ends
#inner screen border
fillcolor('#1a1a1a')
fly(-490, -186)
@ -158,6 +159,7 @@ def draw_tv():
draw_tv()
#Instructional Text
def instructions_text():
fly(-540, -290)
color("white")
@ -172,7 +174,9 @@ def detect_circle_click(x_pos, y_pos):
nextScreen()
elif x_pos > -266.0 and x_pos < -235 and y_pos < -70.0 and y_pos > -99.0:
nextScreen()
onscreenclick(detect_circle_click)
#Selects from a random list of colors to change the screen to.
def nextScreen():
hideturtle()
screen_colors = ['white', 'black', 'red', 'green', 'blue', 'cyan', 'yellow', 'magenta',
@ -191,6 +195,5 @@ def nextScreen():
rectangle(180, 158, 5)
end_fill()
onscreenclick(detect_circle_click)
mainloop() #what does this do?
mainloop()
done() #prevents window from closing