用 Python Turtle 绘制 Q 版狮子头:代码中的霸气与可爱并存

用 Python Turtle 绘制 Q 版狮子头:代码中的霸气与可爱并存

🐸 前言 🐸

狮子,作为“百兽之王”,象征着勇气与力量。然而,当我们将它的形象转化为 Q 版狮子头 时,霸气和可爱就巧妙地结合在了一起。今天,我们将通过 Python 的 Turtle 模块,绘制出一个充满活力的 Q 版狮子头。这个狮子头不仅充满了可爱的圆润造型,还有着象征力量的鬃毛和眼神。

🐞往期绘画>>点击进所有绘画🐞

序号链接
01🦖用 Python 与 Turtle 创作属于你的“冰墩墩”!🦖
02🦖用 Python 与 Turtle 创作属于你的“雪容融”!🦖
03🦖百变小樱魔法阵全解析🦖
04🦖魔法少女全解析🦖
05🦖重现汤姆劈树的经典瞬间🦖
06🐿️喜羊羊与灰太狼之喜羊羊绘画🐿️
07🐿️喜羊羊与灰太狼之懒羊羊绘画🐿️
08🐿️喜羊羊与灰太狼之沸羊羊翻身🐿️
09🐿️神奇宝贝🐿️
10⏰Q 版蜘蛛侠:代码里的超级英雄⏰
11⏰经典汤姆猫:重温卡通角色的经典魅力⏰
12⏰经典杰瑞鼠:捕捉卡通世界中的小聪明⏰
13⏰罗小黑:用代码呈现可爱与奇幻的萌宠⏰
14🎃麻衣学姐:从代码中描绘温柔的学姐形象🎃
15🎃小猪佩奇的涂鸦乐园🎃
16💥💥更多点击💥💥

🐋 效果图 🐋

在这里插入图片描述

🐉 代码 🐉

import turtle as t
def hair():  # 画头发
    t.penup()
    t.goto(-50, 150)
    t.pendown()
    t.fillcolor('#a2774d')
    t.begin_fill()
    for j in range(10):  # 重复执行10次
        t.setheading(60 - (j * 36))  # 每次调整初始角度
        t.circle(-50, 120)  # 画120度的弧
    t.end_fill()
def face():  # 画脸
    t.penup()
    t.goto(0, 100)
    t.pendown()
    t.fillcolor('#f2ae20')
    t.begin_fill()
    t.setheading(180)
    t.circle(85)
    t.end_fill()
    # 下巴
    t.circle(85, 120)
    t.fillcolor('white')
    t.begin_fill()
    t.circle(85, 120)
    t.setheading(135)
    t.circle(100, 95)
    t.end_fill()
def ears(dir):  # 画眼睛,dir用来设置方向,左右眼对称
    t.penup()
    t.goto((0 - dir) * 30, 90)
    t.setheading(90)
    t.pendown()
    t.fillcolor('#f2ae20')
    t.begin_fill()
    t.circle(dir * 30)
    t.end_fill()
    t.penup()
    t.goto((0 - dir) * 40, 85)
    t.setheading(90)
    t.pendown()
    t.fillcolor('white')
    t.begin_fill()
    t.circle(dir * 17)
    t.end_fill()
def nose():  # 画鼻子
    t.penup()
    t.goto(20, 0)
    t.setheading(90)
    t.pendown()
    t.fillcolor('#a2774d')
    t.begin_fill()
    t.circle(20)
    t.end_fill()
def eye(dir):  # 画耳朵,dir用来设置方向,左右耳对称
    t.penup()
    t.goto((0 - dir) * 30, 20)
    t.setheading(0)
    t.pendown()
    t.fillcolor('black')
    t.begin_fill()
    t.circle(10)
    t.end_fill()
def mouth():  # 画嘴巴
    t.penup()
    t.goto(0, 0)
    t.setheading(-90)
    t.pendown()
    t.forward(50)
    t.setheading(0)
    t.circle(80, 30)
    t.penup()
    t.goto(0, -50)
    t.setheading(180)
    t.pendown()
    t.circle(-80, 30)
hair()
ears(1)
ears(-1)
face()
eye(1)
eye(-1)
mouth()
nose()
t.done()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

栗子风暴

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值