python画哆啦A梦

这段代码使用Python的turtle模块详细绘制了哆啦A梦的形象,包括头部、围巾、脸部特征、身体、手脚、口袋和铃铛等部分。
摘要由CSDN通过智能技术生成
from turtle import *
from time import sleep

w = 800
h = 800
setup(w, h, 631, 44)
bgcolor('#08203D')


def pen_goto(a, b):
    up()
    goto(a, b)
    down()


def ref_line():
    pencolor('Grey')
    pensize(1)
    speed(0)
    sq = 50
    dot(10, 'Gold')

    row_y = h/2
    for i in range(int(h/sq - 1)):
        row_y -= sq
        pen_goto(- w/2, row_y)
        fd(w)
    seth(90)

    col_x = w/2
    for i in range(int(w/sq - 1)):
        col_x -= sq
        pen_goto(col_x, - w/2)
        fd(h)
    seth(0)


def head():
    pen_goto(0, 0)
    setheading(0)
    up()
    circle(160, 40)
    begin_fill()
    down()
    circle(160, 280)
    fillcolor('#00a0de')
    end_fill()


def scarf():
    begin_fill()
    fillcolor('red')
    seth(0)
    fd(215)
    circle(-5, 90)
    fd(15)
    circle(-5, 90)
    fd(225)
    circle(-5, 90)
    fd(15)
    circle(-5, 90)
    fd(10)
    end_fill()


def face():
    begin_fill(
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值