用Python画哆啦A梦

简介: 用Python语言进行编码,画哆啦A梦。

用Python语言进行编码,画哆啦A梦。

import turtle

turtle.speed(5)
turtle.circle(50)
turtle.begin_fill() #画头
turtle.circle(85)
turtle.fillcolor("blue")
turtle.end_fill()

turtle.penup()

turtle.goto(0,20)

turtle.pendown()

turtle.begin_fill()

turtle.circle(35)

turtle.fillcolor("white")

turtle.end_fill()

turtle.begin_fill() #画脸
turtle.circle(60)
turtle.fillcolor("white")
turtle.end_fill()

turtle.penup()
turtle.goto(-20,95) #化左眼眶
turtle.pendown()
turtle.begin_fill()
turtle.circle(19)
turtle.fillcolor("white")
turtle.end_fill()

turtle.penup() #画右眼眶
turtle.goto(20,95)
turtle.pendown()
turtle.begin_fill()
turtle.circle(19)
turtle.fillcolor("white")
turtle.end_fill()

turtle.penup() #化左眼珠
turtle.goto(-8,111)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor("black")
turtle.circle(3)
turtle.end_fill()

turtle.penup() #画右眼珠
turtle.goto(8,111)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor("black")
turtle.circle(3)
turtle.end_fill()

turtle.penup() #画鼻子
turtle.goto(0,85)
turtle.pendown()
turtle.begin_fill()
turtle.circle(10)
turtle.fillcolor("red")
turtle.end_fill()

turtle.goto(0,30) #画竖线

turtle.penup() #左边第一根胡子
turtle.goto(-20,70)
turtle.pendown()
turtle.goto(-45,80)

turtle.penup() #左边第二根胡子
turtle.goto(-20,60)
turtle.pendown()
turtle.goto(-47,60)

turtle.penup() #左边第三根胡子
turtle.goto(-20,50)
turtle.pendown()
turtle.goto(-47,40)

turtle.penup() #右边第三根胡子
turtle.goto(20,50)
turtle.pendown()
turtle.goto(47,40)

turtle.penup() #右边第二根胡子
turtle.goto(20,60)
turtle.pendown()
turtle.goto(47,60)

turtle.penup() #左边第一根胡子
turtle.goto(20,70)
turtle.pendown()
turtle.goto(45,80)

turtle.penup() #右边胳膊1
turtle.goto(50,20)
turtle.pendown()
turtle.goto(100,-10)

turtle.penup() #右边胳膊2
turtle.goto(50,-20)
turtle.pendown()
turtle.goto(80,-40)

turtle.begin_fill()
turtle.goto(100,-10)
turtle.goto(50,20)
turtle.goto(50,-20)
turtle.goto(80,-40)
turtle.fillcolor("yellow")
turtle.end_fill()

turtle.penup() #右手
turtle.goto(100,-50)
turtle.pendown()
turtle.begin_fill()
turtle.circle(20)
turtle.fillcolor("blue")
turtle.end_fill()

turtle.penup() #左边胳膊1
turtle.goto(-50,20)
turtle.pendown()
turtle.goto(-100,-10)

turtle.penup() #左边胳膊2
turtle.goto(-50,-20)
turtle.pendown()
turtle.goto(-80,-40)

turtle.begin_fill()
turtle.goto(-100,-10)
turtle.goto(-50,20)
turtle.goto(-50,-20)
turtle.goto(-80,-40)
turtle.fillcolor("yellow")
turtle.end_fill()

turtle.penup() #左手
turtle.goto(-100,-53)
turtle.pendown()
turtle.begin_fill()
turtle.circle(20)
turtle.fillcolor("blue")
turtle.end_fill()

turtle.penup() #左手
turtle.goto(-50,-20)
turtle.pendown()
turtle.goto(-50,-100)

turtle.penup() #左手
turtle.goto(50,-20)
turtle.pendown()
turtle.goto(50,-100)

turtle.begin_fill()
turtle.penup()
turtle.goto(50,-120)
turtle.pendown()
turtle.circle(10)
turtle.fillcolor("blue")
turtle.end_fill()

turtle.begin_fill()
turtle.goto(20,-120)
turtle.circle(10)
turtle.fillcolor("blue")
turtle.end_fill()

turtle.penup()
turtle.goto(50,-100)
turtle.pendown()
turtle.goto(20,-100)

turtle.penup()
turtle.goto(-50,-120)
turtle.pendown()
turtle.begin_fill()
turtle.circle(10)
turtle.goto(-20,-120)
turtle.circle(10)
turtle.fillcolor("blue")
turtle.end_fill()

turtle.penup()
turtle.goto(-20,-100)
turtle.pendown()
turtle.goto(-50,-100)

turtle.penup()
turtle.goto(-20,-100)
turtle.pendown()
turtle.goto(-20,-85)

turtle.goto(20,-85)
turtle.goto(20,-100)

turtle.penup()
turtle.goto(-50,-20)
turtle.pendown()

turtle.begin_fill()
turtle.goto(50,-20)
turtle.goto(50,-85)
turtle.goto(-50,-85)
turtle.goto(-50,-20)
turtle.fillcolor("blue")
turtle.end_fill()

turtle.penup()
turtle.goto(0,-20) #铃铛
turtle.pendown()
turtle.begin_fill()
turtle.circle(10)
turtle.fillcolor("yellow")
turtle.end_fill()

turtle.penup()
turtle.goto(-10,-10)
turtle.pendown()
turtle.goto(10,-10)

turtle.penup()
turtle.goto(-50,20)
turtle.pendown()
turtle.begin_fill()
turtle.goto(50,20)
turtle.goto(50,0)
turtle.goto(-50,0)
turtle.goto(-50,20)
turtle.fillcolor("red")
turtle.end_fill()

turtle.penup()
turtle.goto(50,0)
turtle.pendown()
turtle.begin_fill()
turtle.circle(10)
turtle.fillcolor("red")
turtle.end_fill()

turtle.penup()
turtle.goto(-50,0)
turtle.pendown()
turtle.begin_fill()
turtle.circle(10)
turtle.fillcolor("red")
turtle.end_fill()

turtle.penup() #内裤
turtle.goto(-50,-70)
turtle.pendown()
turtle.begin_fill()
turtle.goto(50,-70)
turtle.goto(50,-50)
turtle.goto(-50,-50)
turtle.goto(-50,-70)
turtle.fillcolor("red")
turtle.end_fill()

turtle.penup()
turtle.goto(-10,-70)
turtle.pendown()
turtle.begin_fill()
turtle.goto(-10,-85)
turtle.goto(10,-85)
turtle.goto(10,-70)
turtle.goto(-10,-70)
turtle.fillcolor("red")
turtle.end_fill()

turtle.penup()
turtle.goto(-100,200)
turtle.pendown()
s = "升本加油呀"
turtle.write(s,font = ("Arial",30,
"normal"))

turtle.done()

相关文章
|
6月前
|
存储 Python
【python】Python飞机大战游戏开发(源码)【独一无二】
【python】Python飞机大战游戏开发(源码)【独一无二】
107 1
|
8月前
|
Python
Python猪猪侠代码
Python猪猪侠代码
176 3
|
9月前
|
机器学习/深度学习 人工智能 数据可视化
Python:探索编程之美
Python:探索编程之美
45 0
|
数据采集 机器学习/深度学习 人工智能
【我问Crossin】Python 能被运用在哪些领域?
requests 模块的代理通过在 get / post 函数中添加 proixes 参数实现,参考代码
|
C语言 数据格式 Python
蓝桥杯-小朋友排队-python
蓝桥杯-小朋友排队-python
145 0
蓝桥杯-小朋友排队-python
|
算法 索引 Python
Python第一课
Python第一课
118 0
Python第一课
|
数据可视化 Python
中秋节——Python恶作剧
中秋节——Python恶作剧
115 0
中秋节——Python恶作剧
|
数据采集 人工智能 JSON
为什么大家都在学Python?Python到底好在哪?
为什么大家都在学Python?Python到底好在哪?
157 0
|
Python
用 Python 画哆啦 A 梦
用 Python 画哆啦 A 梦
369 0
用 Python 画哆啦 A 梦
|
数据可视化 测试技术 程序员
Python那么火,我只推荐这两本书
Python那么火,我只推荐这两本书
Python那么火,我只推荐这两本书