generated from mwc/project_drawing
Compare commits
No commits in common. "c82a594a05db8dd3e9f1f0670a7f408a64317ce5" and "514af40b47248a05f9952c37a0c55ac35d7e8d3c" have entirely different histories.
c82a594a05
...
514af40b47
|
@ -9,8 +9,7 @@ which allows basic formatting.
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
(I would like to create an animated swimming sea turtle with some bubbles.
|
(Describe your goal for this project. If you want to link to an
|
||||||
If you want to link to an
|
|
||||||
image, move the image to this directory, and then use the following syntax:
|
image, move the image to this directory, and then use the following syntax:
|
||||||
|
|
||||||

|

|
||||||
|
@ -19,8 +18,4 @@ image, move the image to this directory, and then use the following syntax:
|
||||||
|
|
||||||
## Planning
|
## Planning
|
||||||
|
|
||||||
(1. Create a function that draws various sizes of blue bubbles that start low on the screen and then
|
(Include your planning here, including your project milestone.)
|
||||||
move up and also use the easing function to make them behave like bubbles as they move up the screen. This will be my first milestone.
|
|
||||||
A simple drawing and allowing me to play with the animate functions.
|
|
||||||
2. Draw a turtle body and head. Draw turtle fins with parameters of size and transposition to be added to the turtle body.
|
|
||||||
3. Animate the turtle to swim from the bottom right of the screen to the top left increasing in size and moving the fins.)
|
|
||||||
|
|
58
drawing.py
58
drawing.py
|
@ -1,61 +1,7 @@
|
||||||
# drawing.py
|
# drawing.py
|
||||||
# ----------
|
# ----------
|
||||||
# By Hope Wright
|
# By ____(you)___________
|
||||||
#
|
#
|
||||||
# a turtle and bubbles will be drawn and animate swimming across the screen
|
# (Briefly describe what this program does.)
|
||||||
# phase 2 would be to have it start smaller and grow is it swims across the screen to look like it's getting closer
|
|
||||||
# phase 3 would be to animate the bubbles.
|
|
||||||
|
|
||||||
from turtle import *
|
from turtle import *
|
||||||
from superturtle.movement import fly
|
|
||||||
from superturtle.animation import animate
|
|
||||||
import math
|
|
||||||
|
|
||||||
def draw_turtle(size):
|
|
||||||
|
|
||||||
|
|
||||||
#draw an oval for the shell
|
|
||||||
height = size*2
|
|
||||||
width = size*1.5
|
|
||||||
|
|
||||||
steps = 100
|
|
||||||
for i in range(steps + 1):
|
|
||||||
angle = 2 * math.pi * i / steps
|
|
||||||
x = (width) * math.cos(angle)
|
|
||||||
y = (height) * math.sin(angle)
|
|
||||||
goto(x,y)
|
|
||||||
|
|
||||||
#move to top of for head
|
|
||||||
|
|
||||||
penup()
|
|
||||||
left(90)
|
|
||||||
forward(size*4)
|
|
||||||
left(90)
|
|
||||||
forward(size*1.5)
|
|
||||||
pendown()
|
|
||||||
|
|
||||||
#draw a circle for the head
|
|
||||||
circle(size)
|
|
||||||
|
|
||||||
#draw some lines on the shell
|
|
||||||
penup()
|
|
||||||
left(90)
|
|
||||||
forward(size*2)
|
|
||||||
pendown()
|
|
||||||
forward(size*4)
|
|
||||||
right(180)
|
|
||||||
forward(size*2)
|
|
||||||
left(90)
|
|
||||||
forward(size*1.5)
|
|
||||||
penup()
|
|
||||||
left(180)
|
|
||||||
forward(size*1.5)
|
|
||||||
pendown()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
draw_turtle(20)
|
|
||||||
done()
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue