from turtle import *
import time
//初始化窗体位置和大小
setup(1000,800,0,0)
//速度为0
speed(0)
//提起画笔
penup()
//设置对象的旋转角度控制方向
seth(90)
//设置绘制对象的像素距离
fd(340)
seth(0)
//放下画笔
pendown()
//设置绘制速度
speed(5)
//开始填充对象
begin_fill()
//设置填充颜色
fillcolor('red')
//绘制一个圆形设置圆心的x y坐标
circle(50,30)
//循环从1-9从取值设置绘制参数
for i in range(10):
fd(1)
left(10)
circle(40,40)
//循环从1-5从取值设置绘制参数
for i in range(6):
fd(1)
left(3)
circle(80,40)
//循环从1-19从取值设置绘制参数
for i in range(20):
//向前0像素向后5像素
fd(0.5)
//向左转动5度
left(5)
circle(80,45)
for i in range(10):
fd(2)
left(1)
circle(80,25)
for i in range(20):
fd(1)
left(4)
circle(50,50)
time.sleep(0.1)
circle(120,55)
speed(0)
seth(-90)
fd(70)
right(150)
fd(20)
left(140)
circle(140,90)
left(30)
circle(160,100)
left(130)
fd(25)
penup()
right(150)
circle(40,80)
pendown()
left(115)
fd(60)
penup()
left(180)
fd(60)
pendown()
end_fill()
right(120)
circle(-50,50)
circle(-20,90)
speed(1)
fd(75)
speed(0)
circle(90,110)
penup()
left(162)
fd(185)
left(170)
pendown()
circle(200,10)
circle(100,40)
circle(-52,115)
left(20)
circle(100,20)
circle(300,20)
speed(1)
fd(250)
penup()
speed(0)
left(180)
fd(250)
circle(-300,7)
right(80)
circle(200,5)
pendown()
left(60)
begin_fill()
fillcolor('green')
circle(-80,100)
right(90)
fd(10)
left(20)
circle(-63,127)
end_fill()
penup()
left(50)
fd(20)
left(180)
pendown()
circle(200,25)
penup()
right(150)
fd(180)
right(40)
pendown()
begin_fill()
fillcolor('green')
circle(-100,80)
right(150)
fd(10)
left(60)
circle(-80,98)
end_fill()
penup()
left(60)
fd(13)
left(180)
pendown()
speed(1)
circle(-200,23)
//删除所有缓冲对象
exitonclick()
Python绘制红玫瑰特效完整源码含部分注释(引用turtle画布库及time时间库完成)
最新推荐文章于 2024-01-22 10:47:13 发布