diff --git a/__pycache__/spiderweb.cpython-310.pyc b/__pycache__/spiderweb.cpython-310.pyc new file mode 100644 index 0000000..7ed932e Binary files /dev/null and b/__pycache__/spiderweb.cpython-310.pyc differ diff --git a/drawing.py b/drawing.py index 80a98a4..3c244bf 100644 --- a/drawing.py +++ b/drawing.py @@ -6,44 +6,9 @@ from turtle import * from superturtle import * +from superturtle.movement import * +from spiderweb import * -def draw_web(radius, lines): - web_turtle = Turtle() - web_turtle.speed(0) # Set the speed to the fastest - for _ in range(lines): - web_turtle.penup() - web_turtle.goto(0, 0) - web_turtle.pendown() - web_turtle.forward(radius) - web_turtle.backward(radius) - web_turtle.right(360 / lines) - -def draw_spider(size): - spider_turtle = SuperTurtle() - spider_turtle.penup() - spider_turtle.goto(0, -size * 0.5) # Position the spider at the center bottom of the web - spider_turtle.pendown() - # Draw the body - spider_turtle.begin_fill() - spider_turtle.circle(size) - spider_turtle.end_fill() - # Draw legs - angles = [45, 135, 225, 315] - for angle in angles: - spider_turtle.penup() - spider_turtle.goto(0, -size * 0.5) - spider_turtle.setheading(angle) - spider_turtle.pendown() - spider_turtle.forward(size) - spider_turtle.backward(size) - -# Setup the screen -screen = Screen() -screen.bgcolor("white") - -# Draw the web and spider -draw_web(100, 12) # radius of 100 and 12 lines -draw_spider(20) # spider size of 20 - -# Finish up -screen.mainloop() # This is better for some environments than turtle.done() \ No newline at end of file +draw_web(400) +hideturtle() +done()