generated from mwc/project_drawing
43 lines
944 B
Python
43 lines
944 B
Python
from math import *
|
|
from turtle import *
|
|
from superturtle import *
|
|
|
|
def startingPosition(HALF):
|
|
# Sets up a square region with max x-coordinate HALF and min -HALF
|
|
penup()
|
|
setup(HALF * 2 + 40, HALF * 2 + 40)
|
|
bgcolor("aquamarine")
|
|
left(180)
|
|
forward(HALF)
|
|
left(90)
|
|
forward(HALF)
|
|
left(90)
|
|
pendown()
|
|
|
|
def drawPerson(HALF):
|
|
pass
|
|
|
|
def drawBall(HALF):
|
|
# draw a filled circle
|
|
fillcolor("blue")
|
|
begin_fill()
|
|
circle(HALF / 10.0)
|
|
end_fill()
|
|
|
|
def drawJugglingCircle(HALF,OFFSET):
|
|
# Draw 3 balls in a circle. The 3 balls are evenly spaced apart and the first ball starts at OFFSET degrees CCW from the starting position.
|
|
right(60)
|
|
penup()
|
|
circle(2/3 * HALF,OFFSET)
|
|
for i in range(2):
|
|
pendown()
|
|
drawBall(HALF)
|
|
penup()
|
|
circle(2/3 * HALF,120)
|
|
input()
|
|
pendown()
|
|
drawBall(HALF)
|
|
penup()
|
|
circle(2/3 * HALF,120-OFFSET)
|
|
|