generated from mwc/project_drawing
	I added the person's torso, legs, arms, neck, and head.
I was stuck when trying to figure out how to tell the turtle where to make the person's legs. Math had to be done since my rectangle function starts at the bottom left of the rectangle. I had to start the turtle 150 spots lower from the torso so when it made the leg rectangle, it would stop at the torso, since the legs were 150 long. I figured this out by drawing the person on a piece of paper so I could visually see where all the shapes needed to go.
This commit is contained in:
		@@ -7,7 +7,7 @@ I want to create a person waving.  I will animate the person's arm to make the w
 | 
				
			|||||||
## Planning
 | 
					## Planning
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Milestone 1:
 | 
					### Milestone 1:
 | 
				
			||||||
I will create the person by making the rectangle(height,width,color) and circle(radius,color) functions.  The rectangles can be used for the person's arms and legs and the circles can be used for the person's head and eyes.  I will combine them together to make the person.
 | 
					I will create the person by making the rectangle(height,width,color) and circle(radius) functions.  The rectangles can be used for the person's arms and legs and the circles can be used for the person's head and eyes.  I will combine them together to make the person.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Milestone 2:
 | 
					### Milestone 2:
 | 
				
			||||||
I will make the wave animation.  I will use Superturtle to make the person's arm move back and forth in a waving motion.
 | 
					I will make the wave animation.  I will use Superturtle to make the person's arm move back and forth in a waving motion.
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										82
									
								
								drawing.py
									
									
									
									
									
								
							
							
						
						
									
										82
									
								
								drawing.py
									
									
									
									
									
								
							@@ -1,7 +1,85 @@
 | 
				
			|||||||
# drawing.py
 | 
					# drawing.py
 | 
				
			||||||
# ----------
 | 
					# ----------
 | 
				
			||||||
# By ____(you)___________
 | 
					# By James Berent
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# (Briefly describe what this program does.)
 | 
					# (This will make a person and the person will wave)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from turtle import *
 | 
					from turtle import *
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def fly(forw):
 | 
				
			||||||
 | 
					    penup()
 | 
				
			||||||
 | 
					    forward(forw)
 | 
				
			||||||
 | 
					    pendown()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def rectangle(height,width,col):
 | 
				
			||||||
 | 
					    dimensions = [width, height, width, height]
 | 
				
			||||||
 | 
					    color(col)
 | 
				
			||||||
 | 
					    for dim in dimensions:
 | 
				
			||||||
 | 
					        forward(dim)
 | 
				
			||||||
 | 
					        left(90)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def triangle_facing_right(height,col):
 | 
				
			||||||
 | 
					    top_of_tri = (height**2+height**2)**(1/2)
 | 
				
			||||||
 | 
					    color(col)
 | 
				
			||||||
 | 
					    forward(height)
 | 
				
			||||||
 | 
					    left(180)
 | 
				
			||||||
 | 
					    fly(height)
 | 
				
			||||||
 | 
					    right(90)
 | 
				
			||||||
 | 
					    forward(height)
 | 
				
			||||||
 | 
					    right(135)
 | 
				
			||||||
 | 
					    forward(top_of_tri)
 | 
				
			||||||
 | 
					    right(135)
 | 
				
			||||||
 | 
					    fly(height)
 | 
				
			||||||
 | 
					    left(180)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def triangle_facing_left(height,col):
 | 
				
			||||||
 | 
					    top_of_tri = (height**2+height**2)**(1/2)
 | 
				
			||||||
 | 
					    color(col)
 | 
				
			||||||
 | 
					    forward(height)
 | 
				
			||||||
 | 
					    left(90)
 | 
				
			||||||
 | 
					    forward(height)
 | 
				
			||||||
 | 
					    left(135)
 | 
				
			||||||
 | 
					    forward(top_of_tri)
 | 
				
			||||||
 | 
					    left(135)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def circ(radius):
 | 
				
			||||||
 | 
					    circle(radius,360) #found in section 1 link of Typeface Problem set instructions
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rectangle(250,150,"black") #this is the torso
 | 
				
			||||||
 | 
					right(90)
 | 
				
			||||||
 | 
					fly(150)
 | 
				
			||||||
 | 
					left(90)
 | 
				
			||||||
 | 
					rectangle(150,50,"black") #this is the left leg
 | 
				
			||||||
 | 
					fly(100)
 | 
				
			||||||
 | 
					rectangle(150,50,"black") #this is the right leg
 | 
				
			||||||
 | 
					fly(50)
 | 
				
			||||||
 | 
					left(90)
 | 
				
			||||||
 | 
					fly(350)
 | 
				
			||||||
 | 
					right(180)
 | 
				
			||||||
 | 
					rectangle(150,50,"black") #this is right arm
 | 
				
			||||||
 | 
					right(90)
 | 
				
			||||||
 | 
					fly(300)
 | 
				
			||||||
 | 
					left(90)
 | 
				
			||||||
 | 
					rectangle(150,50,"black") #this is left arm
 | 
				
			||||||
 | 
					right(180)
 | 
				
			||||||
 | 
					fly(50)
 | 
				
			||||||
 | 
					right(90)
 | 
				
			||||||
 | 
					fly(230)
 | 
				
			||||||
 | 
					left(90)
 | 
				
			||||||
 | 
					rectangle(10,30,"black") #this is the neck
 | 
				
			||||||
 | 
					left(90)
 | 
				
			||||||
 | 
					fly(5)
 | 
				
			||||||
 | 
					right(90)
 | 
				
			||||||
 | 
					fly(30)
 | 
				
			||||||
 | 
					right(90)
 | 
				
			||||||
 | 
					circ(35) #this is the head
 | 
				
			||||||
 | 
					input()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user