generated from mwc/project_drawing
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:
10
spider.py
10
spider.py
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user