generated from mwc/project_drawing
Compare commits
5 Commits
d50a9548a4
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86be12d7f9 | ||
|
|
5b816196e8 | ||
|
|
f19bae7994 | ||
|
|
e7fa4e9eb7 | ||
|
|
f4eb78122a |
@@ -12,9 +12,13 @@ I will be making a butterfly fluttering its wings. The view will be from the fro
|
|||||||
(Include your planning here, including your project milestone.)
|
(Include your planning here, including your project milestone.)
|
||||||
|
|
||||||
### Milestone 1
|
### Milestone 1
|
||||||
|
Create function for the most used shapes in the project. This will include an oval and wing function that uses the ovals.
|
||||||
|
|
||||||
### Milestone 2
|
### Milestone 2
|
||||||
|
Create a function that actually draw the body of the butterfly using the other functions I wrote prior.
|
||||||
|
|
||||||
### Milestone 3
|
### Milestone 3
|
||||||
|
Create a function that draws the wings of the butterfly using the other functions.
|
||||||
|
|
||||||
|
### Milestone 4
|
||||||
|
Change the bakground color.
|
||||||
|
|||||||
80
drawing.py
80
drawing.py
@@ -1,7 +1,83 @@
|
|||||||
# drawing.py
|
# drawing.py
|
||||||
# ----------
|
# ----------
|
||||||
# By ____(you)___________
|
# By Mishaal
|
||||||
#
|
#
|
||||||
# (Briefly describe what this program does.)
|
# The program draws a butterfly
|
||||||
|
|
||||||
from turtle import *
|
from turtle import *
|
||||||
|
|
||||||
|
from turtle import forward, right
|
||||||
|
from superturtle.movement import fly, no_delay
|
||||||
|
|
||||||
|
import turtle
|
||||||
|
|
||||||
|
screen = turtle.Screen()
|
||||||
|
screen.bgcolor("lightblue")
|
||||||
|
turtle.speed(0)
|
||||||
|
|
||||||
|
|
||||||
|
def draw_oval(width, height, color):
|
||||||
|
fillcolor(color)
|
||||||
|
begin_fill()
|
||||||
|
for i in range(2):
|
||||||
|
circle(width, 90)
|
||||||
|
circle(height, 90)
|
||||||
|
end_fill()
|
||||||
|
|
||||||
|
def draw_wing(x, y, width, height, color, angle):
|
||||||
|
penup()
|
||||||
|
goto(x, y)
|
||||||
|
setheading(angle)
|
||||||
|
pendown()
|
||||||
|
draw_oval(width, height, color)
|
||||||
|
|
||||||
|
|
||||||
|
def draw_body():
|
||||||
|
penup()
|
||||||
|
goto(0,25)
|
||||||
|
setheading(135)
|
||||||
|
pendown()
|
||||||
|
draw_oval(10,100,"black")
|
||||||
|
|
||||||
|
def draw_butterfly():
|
||||||
|
|
||||||
|
|
||||||
|
draw_wing(-10,-40, 50, 120, "indianred",50)
|
||||||
|
draw_wing(-10,-75, 40, 90, "palevioletred", 60)
|
||||||
|
|
||||||
|
draw_wing(10,25, 50, 120, "indianred",220)
|
||||||
|
draw_wing(10,-30, 40, 90, "palevioletred", 210)
|
||||||
|
|
||||||
|
draw_body()
|
||||||
|
|
||||||
|
def draw_a():
|
||||||
|
penup()
|
||||||
|
goto(-7,25)
|
||||||
|
pendown()
|
||||||
|
pensize(3)
|
||||||
|
color("black")
|
||||||
|
|
||||||
|
setheading(100)
|
||||||
|
circle(65,80)
|
||||||
|
pensize(8)
|
||||||
|
forward(1)
|
||||||
|
penup()
|
||||||
|
|
||||||
|
goto(-7,25)
|
||||||
|
pendown()
|
||||||
|
pensize(3)
|
||||||
|
|
||||||
|
setheading(80)
|
||||||
|
circle(-65,80)
|
||||||
|
pensize(8)
|
||||||
|
forward(1)
|
||||||
|
penup()
|
||||||
|
|
||||||
|
|
||||||
|
pensize(5)
|
||||||
|
hideturtle()
|
||||||
|
draw_butterfly()
|
||||||
|
draw_a()
|
||||||
|
|
||||||
|
|
||||||
|
input()
|
||||||
Reference in New Issue
Block a user