updated spidermov

under the help of ChatGPT (Canvas), I turned the spider with its web to the color splash like a firework
The things I could not figure out is how to make it come down from the top and get bigger. I used ChatGPT to generate this code but it didn't work well.
I also added arguments in the function to make it connected with others.
This commit is contained in:
grace-xing6
2024-10-07 21:22:57 -04:00
parent 9c2c2ed520
commit 6a53ed6364
8 changed files with 105 additions and 18 deletions

View File

@@ -19,16 +19,16 @@ def draw_circle(radius, x, y, color=None):
if color:
end_fill() # End the filling
def draw_spider():
def draw_spider(radius):
# Step 1: Draw the big circle (spider body) on top of the small circle
draw_circle(60, 30, 60, color="grey")
draw_circle(radius, 30, 60, color="grey")
# Step 2: Draw the small circle (spider head)
draw_circle(20, 30, 0, color="black")
# Step 3: Draw legs on big circle
draw_legs(60, 30, 60)
draw_legs(radius, 30, 60)
def draw_legs(radius, x, y):
"Draws legs starting from the perimeter of the big circle (spider's body)"
@@ -48,12 +48,12 @@ def draw_legs(radius, x, y):
penup()
backward(leg_length) # Move back to the perimeter of the big circle
def draw_connection_line():
def draw_connection_line(y):
"Draw a line from the top of the big circle (head) to the center of the small circle (body)"
penup()
goto(30, 400)
pendown()
goto(30, 120) # Draw a line to the center of the small circle (spider's body)
goto(30, y) # Draw a line to the center of the small circle (spider's body)
penup()
goto(0, 0)