1.
# coding:utf-8
from turtle import *
import turtle as t
from random import *
def infoPrt():
print('coordinate: ' + str(t.pos()))
print('angle: ' + str(t.heading()))
t.pensize(3)
t.hideturtle()
t.colormode(255)
t.color("black")
t.setup(700, 650)
t.speed(1)
t.st()
#t.dot()
t.pu()
#t.goto(-150,100)
t.goto(-210,86)
t.pd()
infoPrt()
# 头
print('头')
t.seth(85)
t.circle(-100,50)
#t.seth(78)
#t.circle(-100,25)
infoPrt()
t.seth(25)
t.circle(-170,50)
infoPrt()
# 右耳
print('右耳')
t.seth(40)
#t.circle(-250,52)
t.circle(-250,30)
infoPrt()
# 右耳尖
t.begin_fill()
# 左
t.circle(-250,22)
#t.fillcolor("pink")
# 右
t.seth(227)
t.circle(-270, 15)
prePos = t.pos()
infoPrt()
# 下
t.seth(105)
t.circle(100, 32)
t.end_fill()
t.pu()
t.setpos(prePos)
t.pd()
t.seth(212)
t.circle(-270, 28)
prePos = t.pos()
t.pu()
t.goto(t.xcor()+5,t.ycor()-2)
t.pd()
# 躯干
print('躯干')
t.seth(280)
t.circle(500, 30)
infoPrt()
# 臀部
print('臀部')
t.seth(120)
#t.circle(150, -55)
t.circle(150, -11)
p_tail=t.pos()
t.circle(150, -44)
p_butt=t.pos()
infoPrt()
# 尾巴
t.pu()
t.setpos(p_tail)
t.pd()
t.begin_fill()
t.seth(50)
t.fd(25)
t.seth(-50)
t.fd(30)
p_tail1=t.pos
t.seth(-140)
t.fd(36)
t.end_fill()
t.seth(39)
# 右尾和h1
t.fd(72)
# 右尾和v1
t.seth(125)
t.fd(48)
# 右尾和h2
t.seth(40)
t.fd(53)
# 右尾和v2
t.seth(88)
t.fd(45)
# 右尾和h3
t.seth(35)
t.fd(105)
# 右尾和v3
t.seth(105)
t.circle(850, 8)
#t.fd(105)
t.seth(215)
#t.fd(125)
t.circle(850, 11)
t.seth(280)
t.fd(110)
t.seth(220)
t.fd(50)
t.seth(309)
t.fd(56)
# 底盘
print('底盘')
t.pu()
t.setpos(p_butt)
t.pd()
t.seth(20)
t.circle(120, -45)
infoPrt()
t.seth(330)
t.circle(-150, -30)
infoPrt()
prePos = t.pos()
t.pu()
t.goto(t.xcor()+20,t.ycor())
t.pd()
t.seth(230)
t.circle(-70, 120)
p_bot=t.pos()
# 两脚-right
t.pu()
t.setpos(p_butt)
t.setpos(t.xcor()+5,t.ycor()+5)
t.pd()
t.seth(-86)
t.fd(30)
t.seth(-93)
t.fd(33)
t.seth(-225)
t.circle(-150, 22)
# 两脚-left
t.pu()
t.setpos(p_bot)
t.setpos(t.xcor()+85,t.ycor()-43)
t.pd()
t.seth(-105)
t.fd(50)
t.seth(-225)
t.circle(-150, 22)
# 左躯干
print('躯干')
t.pu()
t.setpos(p_bot)
t.pd()
t.seth(90)
t.circle(450, 13)
p_lfhd = t.pos()
t.circle(450, 5)
t.pu()
t.circle(450, 5)
t.pd()
t.circle(450, 6)
infoPrt()
# 左脸
t.begin_fill()
t.fillcolor("pink")
print('左脸')
t.seth(330)
t.circle(50, -90)
infoPrt()
# 左酒窝
t.seth(30)
t.circle(-15, 120)
t.seth(-70)
t.circle(-30, 90)
t.end_fill()
# 左手
t.pu()
t.setpos(p_lfhd)
t.pd()
t.seth(160)
t.circle(150, 30)
infoPrt()
t.seth(180)
t.circle(-30, 150)
t.fd(67)
t.pu()
t.setpos(t.xcor()-40,t.ycor()-60)
t.pd()
t.seth(200)
t.circle(-5, 180)
# 右手
t.pu()
t.setpos(p_lfhd)
t.setpos(t.xcor()+180,t.ycor()+5)
t.pd()
t.seth(200)
t.circle(-50, 100)
t.pu()
t.circle(-50, 15)
t.pd()
t.circle(-50, 65)
t.pu()
t.setpos(t.xcor()+10,t.ycor()-45)
t.pd()
#t.seth(270)
#t.circle(-30, -180)
t.seth(80)
t.fd(10)
t.seth(165)
t.circle(10, 60)
t.seth(90)
t.fd(5)
t.seth(165)
t.circle(10, 60)
t.seth(95)
t.fd(5)
t.seth(185)
t.circle(10, 60)
t.seth(105)
t.fd(10)
t.seth(230)
t.fd(20)
t.seth(145)
t.fd(10)
t.seth(285)
t.fd(20)
# 右酒窝
t.begin_fill()
t.fillcolor("pink")
t.pu()
t.setpos(t.xcor()-40,t.ycor()+110)
t.pd()
t.circle(27, 360)
t.end_fill()
#x-20 ,y+50
"""画嘴"""
color("black", "#F35590")
# 下嘴弧度并填充颜色
penup()
goto(-100, 72)
pendown()
begin_fill()
setheading(260)
forward(60)
circle(-11, 150)
forward(55)
print(position())
penup()
goto(-128.46, 71.97)
pendown()
end_fill()
#嘴中最上方的阴影部分
color("#6A070D", "#6A070D")
begin_fill()
penup()
goto(-99.00, 72.00)
pendown()
penup()
goto(-104.29, 48.3)
pendown()
penup()
goto(-142, 45)
pendown()
penup()
goto(-150.40, 62.74)
pendown()
penup()
goto(-128.46, 71.97)
pendown()
penup()
goto(-99.00, 72.00)
pendown()
end_fill()
#上嘴唇
color("black","#FFD624")
penup()
goto(-168, 65)
pendown()
begin_fill()
setheading(-25)
for i in range(2):
setheading(-25)
circle(35, 70)
end_fill()
#嘴中第二个阴影部分
color("#AB1945", "#AB1945")
penup()
goto(-142, 45)
pendown()
begin_fill()
setheading(40)
circle(-33, 70)
goto(-104,48.3)
penup()
goto(-108,33)
pendown()
setheading(155)
circle(25, 70)
end_fill()
# 左眼
t.pu()
t.color("black")
t.setpos(t.xcor()-40,t.ycor()+90)
t.pd()
t.circle(5)
t.pu()
t.setpos(t.xcor()+5,t.ycor()+10)
t.pd()
t.begin_fill()
t.seth(190)
t.circle(15, 130)
t.seth(310)
t.circle(10, 15)
t.seth(0)
t.circle(17, 133)
t.seth(90)
t.circle(10, 15)
t.end_fill()
t.pu()
t.setpos(t.xcor()+2,t.ycor()-15)
t.pd()
t.color("white")
t.begin_fill()
t.circle(5)
t.end_fill()
# 右眼
t.pu()
t.setpos(t.xcor()+85,t.ycor()+15)
t.pd()
t.color("black")
t.circle(5)
t.pu()
t.setpos(t.xcor()+5,t.ycor()+10)
t.pd()
t.begin_fill()
t.seth(190)
t.circle(20, 130)
t.seth(310)
t.circle(10, 15)
t.seth(0)
t.circle(22, 133)
t.seth(90)
t.circle(13, 15)
t.end_fill()
t.pu()
t.setpos(t.xcor()-7,t.ycor()-15)
t.pd()
t.color("white")
t.begin_fill()
t.circle(7)
t.end_fill()
# 左耳
t.color("black")
t.pu()
t.goto(-210,86)
t.setpos(t.xcor()+15,t.ycor()+38)
t.pd()
t.seth(90)
t.circle(-250,30)
t.begin_fill()
# 左
t.circle(-250,18)
# 右
t.seth(270)
t.circle(-270, 12)
prePos = t.pos()
# 下
t.seth(180)
t.circle(100, 30)
t.end_fill()
t.pu()
t.setpos(prePos)
t.pd()
t.seth(270)
t.circle(-270, 18)
t.screensize(50,50,bg='yellow')
# 输出文字
printer = t.Turtle()
printer.hideturtle()
printer.penup()
printer.goto(-350,-100)
printer.write("皮\n\n",move = True, align="left", font=("楷体", 30, "bold"))
printer.goto(-350,-150)
printer.write("卡\n\n",move = True, align="left", font=("楷体", 30, "bold"))
printer.goto(-350,-200)
printer.write("丘\n\n",move = True, align="left", font=("楷体", 30, "bold"))
printer.goto(-350,-250)
printer.write("!!\n\n",move = True, align="left", font=("楷体", 30, "bold"))
t.hideturtle()
t.done()
#-*- coding: UTF-8 -*-
import turtle as t
# 设置背景颜色,窗口位置以及大小
t.colormode(255)# 颜色模式
t.speed(0)
t.screensize(850,760,"white")#画布大小背景颜色
t.setup(width=850, height=760,startx=260, starty=0) #绘图窗口的大小和起始坐标
# t.bgpic("C:/Users/Angle/Desktop/1.gif")
t.title("专属宝贝的草莓熊!")#设置绘图窗口的标题
t.resizemode('noresize') #大小调整模式:auto,user,noresize
t.tracer(1)
scolor=["#E6005C","#00BFFF","#538a30","#F28500"] # 深色列表
qcolor=["#FF007F","#87CEFA","#7fbc2b","#FFA500"] # 浅色列表
blsize=80 # blsize值,blsize,是大等腰直角三角形的斜边风车等比例缩放
bs=2**0.5/2*blsize # bs是直角边,2**0.5 表示数学中的“根号2”
# zjsjxxb是小等腰直角三角形的斜边,zjb是直角边
zjb=blsize/2 # zjb是小等腰直角三角形的直角边
zjsjxxb=2**0.5 *zjb # zjsjxxb是小等腰直角三角形的斜边
length=1.7*blsize # 风车杆长
width=2/15*blsize # 风车杆宽
def fongche():#风车
t.penup()
t.goto(-205,-42)
t.begin_fill()
t.pensize(4)
t.pencolor("#321320")
t.fillcolor("#D2B48C")
t.circle(15)
t.end_fill()
t.penup()
t.goto(-220,80)
t.pendown()
t.setheading(-90)
t.pensize(width)
t.pencolor("#5f4a1d")
t.forward(length)
t.pensize(2)
t.backward(length)
t.setheading(90)
for i in range(4):
# 小等腰直角三角形
t.color(scolor[i]) # 遍历深色列表scolor
t.begin_fill()
t.forward(zjb)
t.left(90)
t.forward(zjb)
t.left(135)
t.forward(zjsjxxb)
t.end_fill()
#t.pencolor(scolor[i])
#t.pensize(4)
# 大等腰直角三角形
t.color(qcolor[i]) # 遍历浅色列表qcolor
t.begin_fill()
t.backward(zjsjxxb)
t.right(90)
t.forward(bs)
t.left(135)
t.forward(blsize)
t.end_fill()
#t.pencolor(scolor[i])
#t.pensize(4)
# 旋转180度后,画下一片风车叶片
t.right(180)
t.penup()
mling_circle_list = iter([ # 每段弧线(半径,弧角度数)
(18, 360), (14, 360), (10, 360), (6, 360),
(18, 360), (14, 360), (10, 360), (6, 360),
])
def mling_draw_eyeball(zb1,zb2,zb3,zb4):
for zb, color_ in zip([zb1,zb2,zb3,zb4], ['#ffffff', '#482d08', '#000000', '#ffffff']):
t.penup()
t.goto(*zb)
t.pendown()
t.begin_fill()
t.setheading(0)
t.color(color_)
t.pencolor('#000000')
t.pensize(2)
t.circle(*next(mling_circle_list))
t.end_fill()
t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#cb3263")
t.pensize(4)
t.goto(120,110)
t.pendown()
t.begin_fill()
t.goto(200,0)
t.left(-40)
t.circle(-110,105)
t.left(75)
t.goto(170,-110)
t.left(-80)
t.circle(30,40)
t.left(60)
t.circle(-80,70)
t.left(83)
t.circle(-35,95)
t.goto(60,-270)
t.left(-80)
t.circle(-65,70)
t.left(63)
t.circle(35,30)
t.left(130)
t.circle(-65,70)
t.goto(-120,-270)
t.left(-110)
t.circle(-35,80)
t.left(83)
t.circle(-80,50)
t.left(60)
t.circle(-80,60)
t.left(60)
t.circle(30,30)
t.left(20)
t.circle(80,80)
t.left(-105)
t.circle(-70,150)
t.left(50)
t.circle(-170,50)
t.goto(120,110)
#Author:Adversity Awake
t.end_fill()
t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#ffffff")
t.pensize(4)
t.goto(90,60)
t.pendown()
t.begin_fill()
t.right(30)
t.circle(-130,360)
t.end_fill()
t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#f3d2ad")
t.pensize(4)
t.goto(-250,-55)
t.seth(0)
t.pendown()
t.begin_fill()
t.right(-55)
t.circle(-45,270)
t.goto(-220,-75)
t.goto(-250,-55)
t.end_fill()
fongche()
t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#f3d2ad")
t.pensize(4)
t.goto(185,-90)
t.pendown()
t.begin_fill()
t.right(140)
t.circle(43,95)
t.goto(185,-90)
t.end_fill()
t.penup()
t.seth(0)
t.pencolor('#321320')
t.fillcolor('#cb3263')
t.pensize(4)
t.begin_fill()
t.goto(21,0)
t.pendown()
t.circle(123,134)
t.left(-90)
t.circle(40,185)
t.left(-60)
t.circle(120,60)
t.left(-90)
t.circle(50,200)
t.left(-90)
t.circle(100,100)
t.left(-12)
t.circle(100,40)
t.goto(21,0)
t.penup()
#Author:Adversity Awake
t.end_fill()
t.penup()
t.goto(0, 0)
t.seth(0)
t.pencolor('#321320')
t.fillcolor('#ffffff')
t.pensize(4)
t.begin_fill()
t.goto(-70,210)
t.left(140)
t.pendown()
t.circle(30,200)
t.goto(-70,210)
t.penup()
t.end_fill()
t.penup()
t.goto(0, 0)
t.seth(0)
t.pencolor('#321320')
t.fillcolor('#ffffff')
t.pensize(4)
t.begin_fill()
t.goto(90,220)
t.left(45)
t.pendown()
t.circle(22,200)
t.goto(90,220)
t.penup()
t.end_fill()
t.penup()
t.goto(0, 0)
t.seth(0)
t.pencolor('#321320')
t.fillcolor('#ffffff')
t.pensize(4)
t.begin_fill()
t.left(-98)
t.left(90)
t.goto(18,10)
t.pendown()
t.circle(100,134)
t.left(10)
t.circle(110,30)
t.left(10)
t.circle(160,40)
t.circle(85,40)
t.left(2)
t.circle(95,40)
t.left(5)
t.circle(95,60)
t.goto(18,10)
t.penup()
t.end_fill()
t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#8f3a52")
t.pensize(2)
t.goto(25,240)
t.pendown()
t.begin_fill()
t.goto(60,235)
t.left(30)
t.fd(8)
t.left(90)
t.fd(22)
t.circle(90, 8)
t.left(20)
t.circle(90, 8)
t.left(20)
t.circle(90, 20)
t.left(40)
t.circle(50, 20)
t.end_fill()
t.penup()
t.pensize(12)
t.goto(-2,250)
t.pencolor("#4D1F00")
t.fillcolor("#4D1F00")
t.pendown()
t.goto(60,240)
t.end_fill()
t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#8f3a52")
t.pensize(2)
t.goto(-55,193)
t.pendown()
t.begin_fill()
t.left(65)
t.circle(-90, 25)
t.goto(-10,230)
t.left(30)
t.fd(8)
t.left(90)
t.fd(18)
t.circle(90, 8)
t.left(20)
t.circle(90, 10)
t.left(40)
t.circle(90, 30)
t.left(30)
t.circle(40, 20)
t.penup()
t.end_fill()
t.pensize(12)
t.goto(-63,195)
t.pencolor("#4D1F00")
t.fillcolor("#4D1F00")
t.pendown()
t.left(100)
t.circle(-85,45)
t.end_fill()
mling_draw_eyeball((-20,180), (-23,185), (-25,188), (-30,200))
mling_draw_eyeball((30, 193), (27, 200), (25,203), (20,213))
t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#8f3a52")
t.pensize(3)
t.goto(25,105)
p = t.pos()
t.pendown()
t.begin_fill()
t.circle(85, 65)
t.left(16)
t.circle(30, 55)
t.left(20)
t.circle(145, 58)
t.left(8)
t.circle(20, 55)
t.left(8)
t.circle(50, 65)
t.left(-5)
t.circle(310, 8)
t.end_fill()
t.penup()
t.goto(0, 0)
t.seth(0)
t.pencolor('#321320')
t.fillcolor('#a93e54')
t.pensize(3)
t.begin_fill()
t.left(-20)
t.goto(9,66)
t.pendown()
t.circle(68,40)
t.left(10)
t.circle(65,40)
t.left(160)
t.circle(-75,85)
t.left(158)
t.circle(48,37)
t.goto(9,66)
t.penup()
t.end_fill()
t.color('#321320')
t.penup()
t.goto(380,60)
t.pendown()
t.write("我\n们\n要\n幸\n福\n哦\n",align="center",font=("黑体",20,"normal"))
t.penup()
t.goto(290,183)
t.pendown()
# t.write("成\n功\n上\n岸\n",align="center",font=("黑体",10,"normal"))
t.hideturtle()
# t.done()
t.fillcolor("red")
t.begin_fill()
t.circle(10, 180)
t.circle(25, 110)
t.left(50)
t.circle(60, 45)
t.circle(20, 170)
t.right(24)
t.fd(30)
t.left(-8)#原本是10
t.circle(30, 110)
t.fd(20)
t.left(40)
t.circle(90, 70)
t.circle(30, 150)
t.right(30)
t.fd(15)
t.circle(80, 90)
t.left(15)
t.fd(45)
t.right(165)
t.fd(20)
t.left(155)
t.circle(150, 80)
t.left(50)
t.circle(150, 90)
t.end_fill()
# 花瓣1
t.left(150)
t.circle(-90, 70)
t.left(20)
t.circle(75, 105)
t.setheading(60)
t.circle(80, 98)
t.circle(-90, 40)
# 花瓣2
t.left(180)
t.circle(90, 40)
t.circle(-80, 98)
t.setheading(-83)
# 叶子1
t.fd(30)
t.left(90)
t.fd(25)
t.left(45)
t.fillcolor("green")
t.begin_fill()
t.circle(-80, 90)
t.right(90)
t.circle(-80, 90)
t.end_fill()
t.right(135)
t.fd(60)
t.left(180)
t.fd(85)
t.left(90)
t.fd(80)
# 叶子2
t.right(90)
t.right(45)
t.fillcolor("green")
t.begin_fill()
t.circle(80, 90)
t.left(90)
t.circle(80, 90)
t.end_fill()
t.left(135)
t.fd(60)
t.left(180)
t.fd(60)
t.right(90)
t.circle(200, 60)
t.done()
import pygame
import turtle as t
#播放音乐
pygame.mixer.init()
pygame.mixer.music.load(r"F:\公众号\46.画冰墩墩\王溢,崎川 - 2022冬奥冰墩墩(吉祥物).mp3")
pygame.mixer.music.set_volume(0.5)
pygame.mixer.music.play()
##画外轮廓
t.title('冰墩墩')
t.pensize(2)
#t.color('gray')
t.color('lavender')
#画耳朵
t.penup()
t.goto(-50, 160)
t.pendown()
t.left(120)
t.circle(20, 180)
#画左边身体
t.right(60)
t.circle(200, 20)
#画左手
t.right(30)
t.circle(200,15)
#t.right(20)
t.circle(15, 230)
#画左腿
t.right(180)
t.circle(-150, 40)
t.left(80)
t.circle(50, 50)
#画腿中间的弧度
t.left(70)
t.circle(-20, 200)
#画右腿
t.left(90)
t.circle(70, 35)
t.left(90)
t.circle(-80, 25)
t.right(30)
t.circle(200, 28)
#画右手
t.right(45)
t.circle(200, 15)
t.left(20)
t.circle(15, 190)
t.right(30)
t.circle(200, 5)
#画右耳朵
t.right(150)
t.circle(150, 25)
t.right(40)
t.circle(20, 180)
t.right(80)
t.circle(600, 5)
##画内耳朵
#左
t.pensize(1)
t.penup()
t.goto(-53, 158)
t.pendown()
t.color('gray', 'black')
t.begin_fill()
t.right(50)
t.circle(16, 180)
t.end_fill()
#右
t.penup()
t.goto(35, 142)
t.pendown()
t.color('gray', 'black')
t.begin_fill()
t.left(120)
t.circle(15, 180)
t.end_fill()