妹妹画的小恐龙和我用Python画的小恐龙,你更加喜欢谁的!❤️

2021-08-10  本文已影响0人  悦悦学Python

大孔龙

我妹妹非要跟我争谁画的恐龙好看,我这肯定好看很多,图片放上,大家可以说说到底谁的好看。

妹妹画的恐龙

我画的恐龙

效果展示

项目思路解析

配置基本画图设置 窗口界面的标题 窗口的大小 笔的大小 笔的运行速度代码如下:

t.setup(1000,600)               # 设置画布的大小

t.speed(10)                     # 设置画笔速度为10

t.pensize(5)                    # 设置画笔大小

t.pencolor("SpringGreen4")      # 设置画笔颜色

t.title('大孔龙')

先描绘出大孔龙的身体 提笔 画笔前往坐标(250,180)代码如下:

t.penup() # 提笔

t.goto(250,180)  # 画笔前往坐标(250,180)

t.begin_fill()    # 准备填充

t.pendown()      # 落笔

t.seth(120)      # 画笔角度为120°

t.circle(100,140) # 画一个半径为100,角度为140°的圆

t.seth(-96)

t.fd(120)        # 向前移动120

t.circle(-100,50)

t.circle(-80,23)

t.seth(176)

t.fd(20)

t.seth(180)

t.circle(-315,40)

t.seth(270)

t.circle(50,30)

t.circle(10,3)

t.seth(-60)

t.circle(180,40)

t.circle(500,20)

t.circle(750,8)

t.circle(80,60)

t.circle(70,30)

t.fd(90)

t.circle(-80,30)

t.seth(10)

t.fd(60)

t.seth(160)

t.fd(90)

t.seth(22)

t.fd(89)

t.color("LightGreen")      # 设置填充颜色

#t.color('SpringGreen1')

t.end_fill()                # 依据轮廓填充

添加上大孔龙的眼睛代码如下:

t.pencolor("SpringGreen4")

t.penup()

t.goto(128,165)

t.pendown()

t.begin_fill()

t.seth(0)

t.circle(20,360)

t.color((1,1,1))    #填充颜色为白色

t.end_fill()

t.penup()

t.goto(128,185)

t.pendown()

t.seth(0)

t.pensize(15)

t.pencolor((0,0,0))

t.circle(1,360)

t.pensize(5)

t.pencolor("SpringGreen4")

t.penup()

t.goto(177,175)

t.pendown()

t.begin_fill()

t.seth(0)

t.circle(20,360)

t.color((1,1,1))

t.end_fill()

t.penup()

t.goto(177,195)

t.pendown()

t.seth(0)

t.pensize(15)

t.pencolor((0,0,0))

t.circle(1,360)

添加龙爪代码如下:

t.penup()

t.pencolor("Aquamarine4")

t.goto(195,60)

t.pensize(11)

t.pendown()

t.seth(10)

t.fd(34)

t.penup()

t.goto(208,66)

t.pendown()

t.pensize(9)

t.seth(45)

t.fd(21)

t.penup()

t.goto(208,66)

t.pendown()

t.pensize(9)

t.seth(-35)

t.fd(21)

#下爪

t.penup()

t.goto(171,20)

t.pensize(11)

t.pendown()

t.seth(-3)

t.fd(58)

t.penup()

t.goto(213,22)

t.pendown()

t.pensize(9)

t.seth(35)

t.fd(18)

t.penup()

t.goto(213,20)

t.pendown()

t.pensize(9)

t.seth(-55)

t.fd(20)

t.penup()

t.goto(171,20)

t.pensize(14)

t.pendown()

t.seth(-3)

t.fd(39)

t.penup()

t.goto(195,60)

t.pensize(14)

t.pendown()

t.seth(10)

t.fd(10)

添加上大孔龙的小脚丫代码如下:

t.penup()

t.goto(71,-100)

t.pensize(16)

t.pendown()

t.seth(-110)

t.fd(40)

t.penup()

t.goto(55,-140)

t.pendown()

t.pensize(11)

t.seth(-150)

t.fd(28)

t.penup()

t.goto(55,-140)

t.pendown()

t.seth(-70)

t.fd(23)

t.penup()

t.goto(55,-140)

t.pendown()

t.seth(-20)

t.pensize(10)

t.fd(23)

t.seth(-40)

t.pensize(11)

t.fd(8)

#右脚

t.penup()

t.goto(142,-113)

t.pensize(16)

t.pendown()

t.seth(-80)

t.fd(23)

t.penup()

t.goto(145,-133)

t.pendown()

t.pensize(11)

t.seth(-120)

t.fd(30)

t.penup()

t.goto(145,-133)

t.pendown()

t.pensize(11)

t.seth(-70)

t.fd(27)

t.penup()

t.goto(145,-133)

t.pendown()

t.pensize(10)

t.seth(-27)

t.fd(27)

t.pensize(11)

t.seth(-50)

t.fd(8)

添加上龙的牙齿代码如下:

#上牙

t.penup()

t.goto(240,172)

t.pendown()

t.color("Yellow2")

t.pensize(4)

t.seth(-110)

t.fd(12)

t.seth(120)

t.fd(12)

t.penup()

t.goto(220,165)

t.pendown()

t.seth(-110)

t.fd(12)

t.seth(130)

t.fd(12)

t.penup()

t.goto(200,157)

t.pendown()

t.seth(-110)

t.fd(12)

t.seth(140)

t.fd(12)

t.penup()

t.goto(250,180)

t.pensize(5)

t.pencolor("SpringGreen4")

t.pendown()

t.seth(22)

t.bk(88)

#下牙

t.penup()

t.goto(200,140)

t.pendown()

t.color("Yellow2")

t.pensize(4)

t.seth(45)

t.fd(12)

t.seth(-90)

t.fd(12)

t.penup()

t.goto(215,135)

t.pendown()

t.seth(45)

t.fd(12)

t.seth(-90)

t.fd(12)

t.penup()

t.goto(230,130)

t.pendown()

t.seth(45)

t.fd(12)

t.seth(-90)

t.fd(12)

t.penup()

t.goto(251,119)

t.pensize(5)

t.pencolor("SpringGreen4")

t.pendown()

t.seth(160)

t.fd(89)

添加上龙脊 龙脊添加的数据是差不多的可以直接使用for循环添加代码如下:

t.penup()

t.goto(120,220)

t.pensize(5)

t.pendown()

t.pencolor("SeaGreen")

#自头而尾  14片

#1

t.begin_fill()

t.color('SeaGreen')

t.seth(160)

t.fd(40)

t.seth(-60)

t.fd(33)

t.end_fill()

#2

t.begin_fill()

t.color('SeaGreen')

t.seth(180)

t.fd(40)

t.seth(-60)

t.fd(33)

t.end_fill()

#3

t.begin_fill()

t.color('SeaGreen')

t.seth(200)

t.fd(40)

t.seth(-50)

t.fd(38)

t.end_fill()

#4

t.begin_fill()

t.color('SeaGreen')

t.seth(205)

t.fd(40)

t.seth(-50)

t.fd(46)

t.end_fill()

#5

t.begin_fill()

t.color('SeaGreen')

t.seth(220)

t.fd(40)

t.seth(-50)

t.fd(41.2)

t.end_fill()

#6

t.begin_fill()

t.color('SeaGreen')

t.seth(190)

t.fd(40)

t.seth(-50)

t.fd(40.8)

t.end_fill()

#7

t.begin_fill()

t.color('SeaGreen')

t.seth(168)

t.fd(44)

t.seth(-89)

t.fd(47)

t.end_fill()

#8

t.begin_fill()

t.color('SeaGreen')

t.seth(138)

t.fd(33)

t.seth(-120)

t.fd(28)

t.end_fill()

#9

t.begin_fill()

t.color('SeaGreen')

t.seth(118)

t.fd(32)

t.seth(-120)

t.fd(28)

t.end_fill()

#10

t.begin_fill()

t.color('SeaGreen')

t.seth(118)

t.fd(32)

t.seth(-120)

t.fd(30)

t.end_fill()

#11

t.begin_fill()

t.color('SeaGreen')

t.seth(118)

t.fd(32)

t.seth(-120)

t.fd(24)

t.end_fill()

#12

t.begin_fill()

t.color('SeaGreen')

t.seth(118)

t.fd(32)

t.seth(-120)

t.fd(24)

t.end_fill()

#13

t.begin_fill()

t.color('SeaGreen')

t.seth(110)

t.fd(32)

t.seth(-120)

t.fd(24)

t.end_fill()

#14

t.begin_fill()

t.color('SeaGreen')

t.seth(110)

t.fd(32)

t.seth(-120)

t.fd(22)

t.end_fill()

#补充没上色的部分

t.penup()

t.pensize(7)

t.goto(-99,-49)

t.pendown()

t.seth(-1)

t.fd(86)

t.seth(0)

t.fd(6)

t.seth(40)

t.fd(30)

t.seth(50)

t.fd(48)

t.seth(90)

t.fd(15)

t.done()

圆满结束~哈哈哈哈,还有更多好玩的代码可以关+私我呀~

上一篇 下一篇

猜你喜欢

热点阅读