能和喜欢的人在一起是一件多么美好幸福的事,可现实却并非如此,喜欢的我不敢表白,我们往往都感觉喜欢的那个人特别的优秀,也就是情人眼里出西施,即使互相都喜欢了,又有些人因羞于表达,或怕被拒绝而错过了对方,爱情就是这般捉弄人。有一首歌写得好,爱需要勇气,确实如此,希望看到这的你,能勇敢迈出第一步,勇敢追求自己的幸福,收获美好的爱情。文章末尾有惊喜。
1.遇见你我很幸运
❤❤
要是有机会的话,我想和你一起喝奶茶,一起看电影一起吹晚风回家,一起走剩下的路,我的意思是:和你。
完整源码:
代码里面可以把文案与名字改改,你喜欢的那个人或者表白的那个人名字,奈斯。
import turtle
import time
# 清屏函数
def clear_all():
turtle.penup()
turtle.goto(0, 0)
turtle.color('white')
turtle.pensize(800)
turtle.pendown()
turtle.setheading(0)
turtle.fd(300)
turtle.bk(600)
# 重定位海龟的位置
def go_to(x, y, state):
turtle.pendown() if state else turtle.penup()
turtle.goto(x, y)
# 画线
# state为真时海龟回到原点,为假时不回到原来的出发点
def draw_line(length, angle, state):
turtle.pensize(1)
turtle.pendown()
turtle.setheading(angle)
turtle.fd(length)
turtle.bk(length) if state else turtle.penup()
turtle.penup()
# 画箭羽
def draw_feather(size):
angle = 30 # 箭的倾角
feather_num = size // 6 # 羽毛的数量
feather_length = size // 3 # 羽毛的长度
feather_gap = size // 10 # 羽毛的间隔
for i in range(feather_num):
draw_line(feather_gap, angle + 180, False) # 箭柄,不折返
draw_line(feather_length, angle + 145, True) # 羽翼,要折返
draw_line(feather_length, angle + 145, False)
draw_line(feather_num * feather_gap, angle, False)
draw_line(feather_length, angle + 145 + 180, False)
for i in range(feather_num):
draw_line(feather_gap, angle + 180, False) # 箭柄,不折返
draw_line(feather_length, angle - 145, True) # 羽翼,要折返
draw_line(feather_length, angle - 145, False)
draw_line(feather_num * feather_gap, angle, False)
draw_line(feather_length, angle - 145 + 180, False)
# 画爱心
def draw_heart(size):
turtle.color('red', 'pink')
turtle.pensize(2)
turtle.pendown()
turtle.setheading(150)
turtle.begin_fill()
turtle.fd(size)
turtle.circle(size * -3.745, 45)
turtle.circle(size * -1.431, 165)
turtle.left(120)
turtle.circle(size * -1.431, 165)
turtle.circle(size * -3.745, 45)
turtle.fd(size)
turtle.end_fill()
def hart_arc():
for i in range(200):
turtle.right(1)
turtle.forward(2)
# 画箭
def draw_arrow(size):
angle = 30
turtle.color('black')
draw_feather(size)
turtle.pensize(4)
turtle.setheading(angle)
turtle.pendown()
turtle.fd(size * 2)
# 一箭穿心
# 箭的头没有画出来,而是用海龟来代替
def arrow_heart(x, y, size):
go_to(x, y, False)
draw_heart(size * 1.15)
turtle.setheading(-150)
turtle.penup()
turtle.fd(size * 2.2)
draw_heart(size)
turtle.penup()
turtle.setheading(150)
turtle.fd(size * 2.2)
draw_arrow(size)
# 画出发射爱心的小人
def draw_people(x, y):
turtle.penup()
turtle.goto(x, y)
turtle.pendown()
turtle.pensize(2)
turtle.color('black')
turtle.setheading(0)
turtle.circle(60, 360)
turtle.penup()
turtle.setheading(90)
turtle.fd(75)
turtle.setheading(180)
turtle.fd(20)
turtle.pensize(4)
turtle.pendown()
turtle.circle(2, 360)
turtle.setheading(0)
turtle.penup()
turtle.fd(40)
turtle.</