一箭串心

import turtle
import time
def curveMove():
    for i in range(200):
        turtle.speed(10)
        turtle.right(1)
        turtle.forward(1)

def curveMove2():  # 第二个半圆
    for i in range(180):  # 第二个心的圆弧度
        turtle.speed(10)
        turtle.right(1)  # 顺时针旋转
        turtle.forward(1)  # 前进1px

def allow():
    turtle.pensize(3)
    turtle.speed(1)
    turtle.color('blue')
    turtle.forward(390)
    turtle.left(130)
    turtle.forward(30)
    turtle.left(180)
    turtle.forward(30)
    turtle.right(80)
    turtle.forward(30 )


def drawHeart():
    turtle.speed(1)#画笔速度调到最高
    turtle.color('blue','red')
    turtle.begin_fill()
    turtle.left(140)#逆时针旋转140度
    turtle.forward(111.65)#向前移动111,65个像素
    #turtle.forward(250)#向前移动111,65个像素
    curveMove()#画曲线
    turtle.left(120)#逆时针旋转120度 right是顺时针移动角度
    curveMove()#继续画曲线
    turtle.forward(111.65)#向前移动111,65个像素
    turtle.end_fill()

def half_drawHeart():#第二个半心
    turtle.speed(1)
    turtle.color('blue','red')#蓝色面,红色填充
    turtle.begin_fill()
    turtle.left(180)
    curveMove2()#第二个心的曲线
    #turtle.left(20)
    turtle.forward(111.65)#第二个心的直线长度
    turtle.right(80)
    turtle.forward(45)
    turtle.end_fill()


def my_goto(x,y):
    turtle.penup()
    turtle.goto(x,y)
    turtle.pendown()

if __name__ == '__main__':
    drawHeart()
    my_goto(85,160)#半心起点
    half_drawHeart()
    my_goto(-150,80)
    turtle.right(135)
    allow()
    my_goto(130,0)
    turtle.write('by love',font=('Bradley Hand ITC',30,'bold'))
    my_goto(230,300)
    time.sleep(10)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值