generated from mwc/project_drawing
I was struggling how to draw an oval for my penguin. I needed to look up videos/read up how to do it. I also had to look up how to set the size of the image. I found it really difficult to just start the penguin, but once I got the shapes I felt more comfortable. Commit 2: Created an iteration of penguins Created a function penguins which iterates the drawing of the penguin until the end of the screen. I needed to do some debugging for this to work, I managed to solve it, but I don't know how I fixed the issue. For some strange reason it's drawing the first penguin twice and I don't know why. I need to figure that out. This part was much easier than drawing out the shapes.
25 lines
784 B
Python
25 lines
784 B
Python
from drawing import *
|
|
from turtle import *
|
|
def penguins(ax):
|
|
for x in range (ax, -500, -100):
|
|
pendown()
|
|
# Body (tall oval)
|
|
draw_oval(x-60, 10, rx=28, ry=70, tilt=0, fill="black")
|
|
# Belly (smaller inner oval)
|
|
draw_oval(x-42, 12, rx=12, ry=65, tilt=0,fill="white")
|
|
# Arm (middle oval)
|
|
draw_oval(x-57, -5, rx=13, ry=30, tilt=0, fill="black")
|
|
# Head (circle = oval with equal radii)
|
|
draw_oval(x-42, 80, rx=25, ry=25, fill="black")
|
|
# Beak (little triangle pointing right)
|
|
right_triangle(x-28, 60, 25, 20, fill="gold")
|
|
# Feet (two small triangles resting on ice)
|
|
right_triangle(x-50, -60, 35, 15, fill="gold")
|
|
penup()
|
|
|
|
|
|
penguins (120)
|
|
|
|
|
|
|