当前位置:网站首页>【Turtle表白合集】“海底月是天上月,眼前人是心上人。”余生多喜乐,长平安~(附3款源码)
【Turtle表白合集】“海底月是天上月,眼前人是心上人。”余生多喜乐,长平安~(附3款源码)
2022-06-10 22:42:00 【程序员梨子】
前言
作者 :“程序员梨子”
**文章简介 **:本篇文章主要是写了使用Turtle写了几款表白的小代码啦~
**文章源码免费获取 : 为了感谢每一个关注我的小可爱每篇文章的项目源码都是无
偿分享滴
所有文章完整的素材+源码都在
正文
心里一直喜欢她,但是我也知道不是她喜欢的类型。暗恋是一个人的兵荒马乱吧,在学校我熟悉你
吃饭、取快递的时间,在这个时间点各种找借口制造偶遇,其实只是想多看你一眼啊。见到你就
躲,见不到你就满校园找你。疫情没有开学,连这点快乐也没有了。你的微博、朋友圈我都可以背
下来了。我看着你的生活,喜怒哀乐都不为我,但却足以影响我的喜怒哀乐。今天是
我认识你的第600天,希望你开心,你知道乌鸦为什么像写字台吗?
——来自一位粉丝投稿

![]()
这些小文案跟小代码送给你,希望你喜欢( ω )。
一、玫瑰+文案
明明早已百无禁忌,偏偏你是一百零一。
跟你在一起的时光都
很耀眼
因为天气好
因为天气不好
因为天气刚刚好
每一天,都很美好。
——《鬼怪》
1)效果展示

2)代码展示
from turtle import *
setup(650, 750, 0, 0)
colormode(255)
pencolor("black")
pu()
goto(-30, -66)
pd()
begin_fill()
color("black", "red")
seth(105)
circle(-80, 100)
circle(-200, 55)
seth(209)
circle(-332, 43)
end_fill()
pu()
begin_fill()
color("black", (139,69,19))
goto(-49, -64)
pd()
seth(135)
fd(23)
seth(252)
fd(32)
seth(242)
circle(1100, 8)
seth(0)
fd(10)
seth(70)
circle(-760, 13)
end_fill()
pu()
goto(-99, -153)
color("black", "green")
pd()
begin_fill()
seth(55)
circle(-80, 90)
seth(190)
end_fill()
fd(110)
pu()
goto(-95, -163)
pd()
begin_fill()
backward(100)
seth(225)
circle(-90, 70)
end_fill()
pu()
goto(-107,-89)
pd()
begin_fill()
seth(120)
fd(110)
seth(340)
circle(-90, 80)
end_fill()
pu()
goto(-107, -106)
pd()
begin_fill()
seth(120)
fd(90)
seth(250)
circle(60, 100)
end_fill()
pu()
goto(-73, -25)
color("black", "red")
pd()
begin_fill()
seth(90)
circle(260, 50)
seth(45)
fd(130)
seth(330)
circle(-120, 50)
seth(230)
fd(35)
seth(120)
fd(40)
seth(45)
backward(20)
seth(300)
circle(-200, 60)
end_fill()
pu()
goto(-45, -50)
pd()
begin_fill()
seth(135)
fd(25)
seth(60)
circle(200, 40)
seth(40)
circle(200, 50)
seth(300)
fd(110)
seth(240)
circle(500, 13)
seth(190)
circle(105, 85)
end_fill()
pu()
goto(105, 40)
pd()
begin_fill()
seth(350)
circle(-200, 30)
seth(35)
fd(30)
seth(115)
circle(-400, 32)
seth(160)
circle(120, 50)
seth(290)
fd(50)
seth(20)
fd(35)
seth(300)
circle(-120, 40)
seth(220)
fd(50)
seth(250)
fd(40)
end_fill()
pu()
goto(85, 44)
pd()
begin_fill()
seth(65)
circle(250, 27)
seth(200)
fd(15)
seth(270)
fd(30)
seth(220)
circle(100, 50)
seth(355)
fd(28)
end_fill()
pu()
goto(117, 100)
pd()
begin_fill()
seth(30)
fd(13)
seth(120)
fd(20)
seth(270)
fd(25)
end_fill()
pu()
goto(122, 145)
pd()
begin_fill()
seth(335)
fd(15)
seth(120)
fd(30)
seth(270)
fd(25)![]()
二、接收我的爱+文案
月亮照回湖心,野鹤奔向闲云,我步入你。
——仓央嘉措
1)效果展示

2)代码展示
import turtle
str = input('请输入表白语:')
turtle.speed(10)#画笔速度
turtle.setup(1800,700,70,70)
turtle.color('black', 'pink')# 画笔颜色
turtle.pensize(3) # 画笔粗细
turtle.hideturtle() # 隐藏画笔(先)
turtle.up() # 提笔
turtle.goto(-655, -255) # 移动画笔到指定起始坐标(窗口中心为0,0)
turtle.down() #下笔
turtle.showturtle() #显示画笔
#画左边的小人
turtle.goto(-600,-200)
turtle.goto(-600,-120)
turtle.circle(35)
turtle.goto(-600,-200)
turtle.forward(40)
turtle.right(90)
turtle.forward(60)
turtle.hideturtle()
turtle.up()
turtle.goto(-600, -160)
turtle.down()
turtle.showturtle()
turtle.left(90)
turtle.forward(55)
turtle.right(45)
turtle.forward(20)
turtle.hideturtle()
turtle.up()
turtle.goto(-600, -145)
turtle.down()
turtle.showturtle()
turtle.goto(-545, -145)
turtle.left(90)
turtle.forward(20)
#画第一个爱心
turtle.color('pink', 'pink')
turtle.begin_fill()
turtle.hideturtle()
turtle.up()
turtle.goto(-500, -153)
turtle.down()
turtle.showturtle()
turtle.right(90)
turtle.forward(30)
turtle.left(90)
turtle.forward(30)
turtle.left(45)
turtle.circle(10.6,180)
turtle.left(180)
turtle.circle(10.6,180)
turtle.end_fill()
#下一个大爱心
turtle.color('green', 'green')
turtle.begin_fill()
turtle.hideturtle()
turtle.up()
turtle.goto(-430, -143)
turtle.down()
turtle.showturtle()
turtle.left(135)
turtle.right(90)
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.left(45)
turtle.circle(17.67,180)
turtle.left(180)
turtle.circle(17.67,180)
turtle.end_fill()
#第三个爱心
turtle.color('red', 'red')
turtle.begin_fill()
turtle.hideturtle()
turtle.up()
turtle.goto(-315, -133)
turtle.down()
turtle.showturtle()
turtle.left(135)
turtle.right(90)
turtle.forward(70)
turtle.left(90)
turtle.forward(70)
turtle.left(45)
turtle.circle(24.74,180)
turtle.left(180)
turtle.circle(24.74,180)
turtle.end_fill()
#第四个爱心
turtle.color('red', 'red')
turtle.begin_fill()
turtle.hideturtle()
turtle.up()
turtle.goto(-187, -133)
turtle.down()
turtle.showturtle()
turtle.left(135)
turtle.right(90)
turtle.forward(70)
turtle.left(90)
turtle.forward(70)
turtle.left(45)
turtle.circle(24.74,180)
turtle.left(180)
turtle.circle(24.74,180)
turtle.end_fill()
#第5个爱心
turtle.color('green', 'green')
turtle.begin_fill()
turtle.hideturtle()
turtle.up()
turtle.goto(-43.7, -143)
turtle.down()
turtle.showturtle()
turtle.left(135)
turtle.right(90)
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.left(45)
turtle.circle(17.67,180)
turtle.left(180)
turtle.circle(17.67,180)
turtle.end_fill()
#第6个爱心
turtle.color('pink', 'pink')
turtle.begin_fill()
turtle.hideturtle()
turtle.up()
turtle.goto(53.88, -153)
turtle.down()
turtle.showturtle()
turtle.right(90)
turtle.right(225)
turtle.forward(30)
turtle.left(90)
turtle.forward(30)
turtle.left(45)
turtle.circle(10.6,180)
turtle.left(180)
turtle.circle(10.6,180)
turtle.end_fill()
#画右边的小人
turtle.hideturtle()
turtle.up()
turtle.goto(251.28, -255)
turtle.down()
turtle.showturtle()
turtle.goto(196.28,-200)
turtle.goto(196.28,-120)
turtle.left(90)
turtle.circle(35)
turtle.goto(196.28,-200)
turtle.left(180)
turtle.forward(40)
turtle.left(90)
turtle.forward(60)
turtle.hideturtle()
turtle.up()
turtle.goto(196.28,-160)
turtle.down()
turtle.showturtle()
turtle.right(90)
turtle.forward(55)
turtle.left(45)
turtle.forward(20)
turtle.hideturtle()
turtle.up()
turtle.goto(196.28, -145)
turtle.down()
turtle.showturtle()
turtle.right(45)
turtle.forward(55)
turtle.right(45)
turtle.forward(20)
#画气球线和气球
#第一个气球
turtle.hideturtle()
turtle.up()
turtle.goto(-265, -133)
turtle.down()
turtle.showturtle()
turtle.goto(-245, 0)
turtle.right(135)
turtle.circle(35)
#第2个气球
turtle.hideturtle()
turtle.up()
turtle.goto(-265, -133)
turtle.down()
turtle.showturtle()
turtle.goto(-305, 80)
turtle.circle(40)
#第3个气球
turtle.hideturtle()
turtle.up()
turtle.goto(-137, -133)
turtle.down()
turtle.showturtle()
turtle.goto(-167, 0)
turtle.circle(35)
#第4一个气球
turtle.hideturtle()
turtle.up()
turtle.goto(-137, -133)
turtle.down()
turtle.showturtle()
turtle.goto(-117, 80)
turtle.circle(40)
#写字LOVE
turtle.pencolor("GREEN")
turtle.penup()
turtle.goto(-245,10)
turtle.write("人",move=False,align='center',font=("微软雅黑",30,'normal'))
turtle.pencolor("PURPLE")
turtle.penup()
turtle.goto(-305,90)
turtle.write("间",move=False,align='center',font=("微软雅黑",30,'normal'))
turtle.pencolor("YELLOW")
turtle.penup()
turtle.goto(-167,10)
turtle.write("清",move=False,align='center',font=("微软雅黑",30,'normal'))
turtle.pencolor("ORANGE")
turtle.penup()
turtle.write("欢",move=False,align='center',font=("微软雅黑",30,'normal'))
#写送给谁
turtle.pencolor("black")
turtle.penup()
turtle.goto(300, 200)
turtle.write(str,move=False,align='center',font=("方正舒体",30,'normal'))
turtle.done()![]()
三、树+文案
为你,千千万万遍。
——追风筝的人
1)效果展示

2)代码展示
import pygame
import random
import time
import turtle
import multiprocessing
def music_play():
pygame.mixer.init()
while True:
music_name = str(random.randint(1, 3)) + '.mp3'
pygame.mixer.music.load('./music/%s' % music_name)
pygame.mixer.music.play(start=1.0)
time.sleep(120)
pygame.mixer.music.stop()
def draw_arc(lv):
for i in range(20):
lv.right(10)
lv.forward(2)
def draw_love(x, y):
love = turtle.Turtle()
love.hideturtle()
love.up()
love.goto(x, y)
love.color('pink', 'red')
love.speed(10000000)
love.pensize(2)
love.down()
love.begin_fill()
love.left(140)
love.forward(22)
draw_arc(love)
love.left(120)
draw_arc(love)
love.forward(22)
love.left(140)
love.end_fill()
def draw_tree(branchLen, tur):
if branchLen > 5:
if branchLen < 20:
tur.color('green')
tur.pensize(random.uniform((branchLen+5)/4-2, (branchLen+6)/4+5))
tur.down()
tur.forward(branchLen)
draw_love(tur.xcor(), tur.ycor())
tur.up()
tur.backward(branchLen)
tur.color('brown')
return
tur.pensize(random.uniform((branchLen+5)/4-2, (branchLen+6)/4+5))
tur.down()
tur.forward(branchLen)
angle = random.uniform(15, 45)
tur.right(angle)
draw_tree(branchLen-random.uniform(12, 16), tur)
tur.left(2*angle)
draw_tree(branchLen-random.uniform(12, 16), tur)
tur.right(angle)
tur.up()
tur.backward(branchLen)
def draw_main():
Win = turtle
tur = turtle.Turtle()
tur.hideturtle()
tur.speed(1000)
tur.left(90)
tur.up()
tur.backward(200)
tur.down()
tur.color("brown")
tur.pensize(32)
tur.forward(60)
draw_tree(100, tur)
Win.exitonclick()
if __name__ == '__main__':
process1 = multiprocessing.Process(target=draw_main)
process2 = multiprocessing.Process(target=music_play)
process1.start()
process2.start()![]()
总结
“你是年少的欢喜
这句话反过来也是你 ”——是你
好啦!这篇文章写到这里就正式结束啦。如果各位喜欢的话,请大家帮忙三联啦~,=
这个目前对小编来说很重要。祝各位,发大财,行大运,身体健康。嘻嘻,老规矩源码找我拿撒
关注小编获取更多精彩内容!记得点击传送门哈
如需打包好的完整源码+素材免费分享滴~找我就可以啦!!
免费的源码基地——
你们的支持是我最大的动力!!记得三连哦~mua 欢迎大家阅读往期的文章哦~
往期游戏热门文章推荐:
项目5.3 《玛丽冒险小游戏》
Python动作冒险类游戏推荐:一款奔跑的玛丽冒险岛游戏、你能坚持几天丫?
项目7.0 赛车游戏
【Pygame实战】如果你是赛车爱好者:这款新赛车游戏分分钟让你上瘾(超跑又是谁的梦想?)
项目7.1 虐单身狗游戏
项目1.0 超级玛丽
程序员自制游戏:超级玛丽100%真实版,能把你玩哭了~【附源码】
项目1.1 扫雷
Pygame实战:据说这是史上最难扫雷游戏,没有之一,你们感受下......
文章汇总——
项目1.0 Python—2021 |已有文章汇总 | 持续更新,直接看这篇就够了
(更多内容+源码都在文章汇总哦!!欢迎阅读~)
文章汇总——
汇总: Python文章合集 | (入门到实战、游戏、Turtle、案例等)
(文章汇总还有更多你案例等你来学习啦~源码找我即可免费!)
![]()
边栏推荐
- 【Opencv实战】这个印章“神器”够牛,节省了时间提高了效率,厉害~(附完整源码)
- Yuntu says that every successful business system cannot be separated from apig
- Is it safe to open an account in Shanghai Securities?
- 细数十大信息安全原则
- Fiddler filtering sessions
- Leetcode 501: mode dans l'arbre de recherche binaire
- LabVIEW 禁止其他可多核心处理的应用程序在所有核心上执行
- 2022 college entrance examination quantitative paper | please answer the questions for quantitative candidates
- Redis installation and common problem solving based on centeros7 (explanation with pictures)
- 示波器刷新率怎么测量
猜你喜欢
![[mathematics] [continuum mechanics] symmetry tensor, strain tensor and stress tensor in fluid mechanics](/img/13/210ed249dfa3010bf69fead8e06f1b.png)
[mathematics] [continuum mechanics] symmetry tensor, strain tensor and stress tensor in fluid mechanics

干货丨MapReduce的工作流程是怎样的?

LeetCode+ 21 - 25

LabVIEW用VISA Read函数来读取USB中断数据

Simple impedance matching circuit and formula

Dell r730 RAID5 installation server 2016 (disk larger than 2t)

Vs tomato assistant add header comments and usage

Data and information resource sharing platform (VII)

LabVIEW displays the time and date on the waveform chart or waveform chart

LeetCode 501 :二叉搜索樹中的眾數
随机推荐
苹果CMS采集站源码-搭建教程-附带源码-全新源码-开发文档
30 | 怎么重设消费者组位移?
Is it safe to open an account online in Shanghai?
BGP - route map extension (explanation + configuration)
Interview questions - written examination
都说验证码是爬虫中的一道坎,看我只用五行代码就突破它。
Data and information resource sharing platform (VII)
【LaTex】latex VS Code snippets(代码片段)
LabVIEW编程规范
LabVIEW或MAX下的VISA测试面板中串口无法工作
LabVIEW open other exe programs
vtk.js中vtp下载
Basic introduction and core components of kubernetes
B 树的简单认识
Analysis of Genesis public chain
The time (in minutes) required for a group of workers to cooperate to complete the assembly process of a part are as follows:
Postgraduate entrance examination English vocabulary unit1
Fiddler configuration
LabVIEW使用MathScript Node或MATLAB脚本时出现错误1046
【数学】【连续介质力学】流体力学中的对称张量、应变张量和应力张量
