Python Turtle召唤童年:《哆啦A梦的奇妙世界》

🐸 前言 🐸

欢迎来到 《哆啦A梦的奇妙世界》,在这个博客里,我们将与来自未来的蓝色猫型机器人——哆啦A梦,一起踏上穿越时空的冒险旅程。自从1970年首次亮相,哆啦A梦便成为了无数人心中永恒的朋友,他不仅是大雄的救星,也是我们的心灵伙伴。
在这个博客里,我们不仅将回顾《哆啦A梦》的经典形象,探索哆啦A梦背后的科学幻想与温情友情,还会与各位一起讨论如何从这个充满无限可能的未来世界中汲取智慧与启发。无论是哆啦A梦的神奇口袋,还是他与小伙伴们的温暖互动,都传递着关爱、勇气与希望。

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

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

🐋 效果图 🐋

在这里插入图片描述

🐉 代码 🐉

from turtle import*
import time

# 设置抬笔跳跃
def my_goto(x, y):
    penup()
    goto(x, y)
    pendown()
# 绘制项圈
def collar():
    color("red")
    pencolor("black")
    begin_fill()
    my_goto(-100, 0)
    lt(10)
    circle(-800, 20)
    rt(70)
    fd(10)
    goto(-100, -10)
    goto(-100, 0)
    end_fill()
# 绘制大脸
def face():
    color("sky blue")
    pencolor("black")
    begin_fill()
    lt(46)
    circle(251,-293)
    lt(10)
    circle(200,273)
    end_fill()
# 绘制眼睛
def eyes():
    # 绘制左眼
    my_goto(-45,338)
    color("white")
    begin_fill()
    pencolor("black")

    tracer(False)
    a = 3
    rt(45)
    for i in range(120):
        if 0 <= i < 30 or 60 <= i < 90:
            a -= 0.05
            lt(3)
            fd(a)
        else:
            a += 0.05
            lt(3)
            fd(a)
    tracer(True)
    end_fill()
    # 绘制左眼球
    color("black")
    begin_fill()
    pencolor("black")
    my_goto(-5, 320)
    circle(15)
    end_fill()

    color("white")
    begin_fill()
    my_goto(10, 318)
    circle(5)
    end_fill()

    # 绘制右眼
    my_goto(45,338)
    color("white")
    begin_fill()
    pencolor("black")

    tracer(False)
    a = 3
    for i in range(120):
        if 0 <= i < 30 or 60 <= i < 90:
            a -= 0.05
            lt(3)
            fd(a)
        else:
            a += 0.05
            lt(3)
            fd(a)
    tracer(True)
    end_fill()
    # 绘制右黑眼球
    color("black")
    begin_fill()
    pencolor("black")
    my_goto(50,320)
    circle(15)
    end_fill()

    color("white")
    begin_fill()
    my_goto(54, 318)
    circle(5)
    end_fill()
# 绘制鼻子
def nose():
    pensize(3)
    color("red")
    begin_fill()
    pencolor("black")
    my_goto(4,272)
    circle(35)
    end_fill()
    # 绘制鼻尖
    color("white")
    begin_fill()
    my_goto(33, 290)
    circle(5)
    end_fill()
# 绘制嘴巴
def mouse():
    pencolor("black")
    my_goto(38,202)
    goto(38,50)
    my_goto(-110,160)
    lt(15)
    circle(150,150)
# 绘制胡子
def beard():
    pencolor("black")
    pensize(4)

    # 绘制左边的胡子
    my_goto(-120,200)
    goto(-20,180)

    my_goto(-120, 170)
    goto(-20,160)

    my_goto(-120, 130)
    goto(-20,140)

    # 绘制右边的胡子
    my_goto(196,200)
    goto(96,180)

    my_goto(196, 170)
    goto(96,160)

    my_goto(196, 130)
    goto(96,140)
# 绘制猫身
def body():
    color("sky blue")
    begin_fill()
    pencolor("black")
    # 左半边的身子
    my_goto(-100, -10)
    rt(35)
    fd(-180)
    circle(-50,-180)
    fd(-80)
    lt(50)
    fd(-60)
    fd(190)
    rt(30)
    fd(60)
    lt(115)
    fd(80)
    lt(10)
    fd(65)
    #机器猫的裤裆
    lt(90)
    circle(-35,190)
    lt(90)
    fd(65)
    rt(-10)
    fd(80)
    # 右半边的身子
    lt(115)
    fd(60)
    rt(35)
    fd(190)
    fd(-60)
    rt(60)
    fd(180)
    circle(50,180)
    goto(185,-10)
    goto(-100, -10)

    end_fill()
# 绘制猫肚子
def belly():
    color("white")
    pencolor("black")
    begin_fill()
    my_goto(-80,-10)
    seth(0)
    lt(80)
    circle(-120, -200)
    end_fill()

    my_goto(-10,-70)
    seth(0)
    lt(80)
    circle(-50, -200)
    goto(-10,-70)
# 绘制铃铛
def bell():
    my_goto(38,-10)
    seth(180)
    color("yellow")
    begin_fill()
    pencolor("black")

    circle(20)

    end_fill()
# 绘制双手
def hand():
    # 绘制左手
    color("white")
    begin_fill()
    pencolor("black")
    my_goto(-230,-125)
    circle(60)
    end_fill()
    # 绘制右手
    color("white")
    begin_fill()
    pencolor("black")
    my_goto(380, 50)
    circle(60)
    end_fill()
# 绘制双脚
def foot():
    # 绘制左脚
    color("white")
    begin_fill()
    pencolor("black")
    my_goto(-10, -330)
    seth(0)
    fd(10)
    circle(-35, 180)
    fd(140)
    circle(-35, 180)
    # fd(10)
    goto(-10,-330)
    end_fill()
    # 绘制右脚
    color("white")
    begin_fill()
    pencolor("black")
    my_goto(220, -330)
    seth(0)
    fd(10)
    circle(-35, 180)
    fd(140)
    circle(-35, 180)
    # fd(10)
    goto(220,-330)
    end_fill()
# 调用函数
def main():
    hideturtle()
    speed(2)
    pensize(3)

    collar()
    face()
    eyes()
    nose()
    mouse()
    beard()
    body()
    belly()
    bell()
    hand()
    foot()
    exitonclick()

if __name__ == '__main__':
    main()
time.sleep(20)   #停止20s
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

栗子风暴

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

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

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

打赏作者

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

抵扣说明:

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

余额充值