generated from mwc/project_drawing
	What got me stuck in the beginning was how can I add more parameters or loops to my existing code. What I figured out was that by adding more parameters and loops to my existing code I would be able to create a drawing that would give me three house and a sun with customizable color of my choosing. A strategy I used to get unstuck was to continue using ideas from previous lessons about parameters and trial and error to see where things went right and wrong. What I wonder is how can I use super turtle to create an animated sun. What I want to learn more about is how to properly use super turtle. Since I have more houses and sun with customizable color my future project idea could be to create three houses and a sun with customizable coloring but this time using super turtle to creaete an animated rising sun.
		
			
				
	
	
		
			50 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
import turtle
 | 
						|
 | 
						|
 | 
						|
def draw_square(pen, size, color="black", fill=None):
 | 
						|
    """Draw a square with optional fill color."""
 | 
						|
    pen.color(color)
 | 
						|
    if fill:
 | 
						|
        pen.fillcolor(fill)
 | 
						|
        pen.begin_fill()
 | 
						|
    for _ in range(4):
 | 
						|
        pen.forward(size)
 | 
						|
        pen.right(90)
 | 
						|
    if fill:
 | 
						|
        pen.end_fill()
 | 
						|
 | 
						|
def draw_rectangle(pen, width, height, color="black", fill=None):
 | 
						|
    """Draw a rectangle with optional fill color."""
 | 
						|
    pen.color(color)
 | 
						|
    if fill:
 | 
						|
        pen.fillcolor(fill)
 | 
						|
        pen.begin_fill()
 | 
						|
    for _ in range(2):
 | 
						|
        pen.forward(width)
 | 
						|
        pen.right(90)
 | 
						|
        pen.forward(height)
 | 
						|
        pen.right(90)
 | 
						|
    if fill:
 | 
						|
        pen.end_fill()
 | 
						|
 | 
						|
def draw_triangle(pen, size, color="black", fill=None):
 | 
						|
    """Draw an equilateral triangle with optional fill color."""
 | 
						|
    pen.color(color)
 | 
						|
    if fill:
 | 
						|
        pen.fillcolor(fill)
 | 
						|
        pen.begin_fill()
 | 
						|
    for _ in range(3):
 | 
						|
        pen.forward(size)
 | 
						|
        pen.left(120)
 | 
						|
    if fill:
 | 
						|
        pen.end_fill()
 | 
						|
 | 
						|
def draw_circle(pen, radius, color="black", fill=None):
 | 
						|
    """Draw a circle with optional fill color."""
 | 
						|
    pen.color(color)
 | 
						|
    if fill:
 | 
						|
        pen.fillcolor(fill)
 | 
						|
        pen.begin_fill()
 | 
						|
    pen.circle(radius)
 | 
						|
    if fill:
 | 
						|
        pen.end_fill() |