python画板——小猪佩奇

话不多说,直接上源码

# coding:utf-8
import turtle as tt.pensize(4)
t.hideturtle()
t.colormode(255)
t.color((255,155,192),"pink")
t.setup(840,500)
t.speed(10)#鼻子
t.pu()
t.goto(-100,100)
t.pd()
t.seth(-30)
t.begin_fill()
a=0.4
for i in range(120):if 0<=i<30 or 60<=i<90:a=a+0.08t.lt(3) #向左转3度t.fd(a) #向前走a的步长else:a=a-0.08t.lt(3)t.fd(a)
t.end_fill()t.pu()
t.seth(90)
t.fd(25)
t.seth(0)
t.fd(10)
t.pd()
t.pencolor(255,155,192)
t.seth(10)
t.begin_fill()
t.circle(5)
t.color(160,82,45)
t.end_fill()t.pu()
t.seth(0)
t.fd(20)
t.pd()
t.pencolor(255,155,192)
t.seth(10)
t.begin_fill()
t.circle(5)
t.color(160,82,45)
t.end_fill()#头
t.color((255,155,192),"pink")
t.pu()
t.seth(90)
t.fd(41)
t.seth(0)
t.fd(0)
t.pd()
t.begin_fill()
t.seth(180)
t.circle(300,-30)
t.circle(100,-60)
t.circle(80,-100)
t.circle(150,-20)
t.circle(60,-95)
t.seth(161)
t.circle(-300,15)
t.pu()
t.goto(-100,100)
t.pd()
t.seth(-30)
a=0.4
for i in range(60):if 0<=i<30 or 60<=i<90:a=a+0.08t.lt(3) #向左转3度t.fd(a) #向前走a的步长else:a=a-0.08t.lt(3)t.fd(a)
t.end_fill()#耳朵
t.color((255,155,192),"pink")
t.pu()
t.seth(90)
t.fd(-7)
t.seth(0)
t.fd(70)
t.pd()
t.begin_fill()
t.seth(100)
t.circle(-50,50)
t.circle(-10,120)
t.circle(-50,54)
t.end_fill()t.pu()
t.seth(90)
t.fd(-12)
t.seth(0)
t.fd(30)
t.pd()
t.begin_fill()
t.seth(100)
t.circle(-50,50)
t.circle(-10,120)
t.circle(-50,56)
t.end_fill()#眼睛
t.color((255,155,192),"white")
t.pu()
t.seth(90)
t.fd(-20)
t.seth(0)
t.fd(-95)
t.pd()
t.begin_fill()
t.circle(15)
t.end_fill()t.color("black")
t.pu()
t.seth(90)
t.fd(12)
t.seth(0)
t.fd(-3)
t.pd()
t.begin_fill()
t.circle(3)
t.end_fill()t.color((255,155,192),"white")
t.pu()
t.seth(90)
t.fd(-25)
t.seth(0)
t.fd(40)
t.pd()
t.begin_fill()
t.circle(15)
t.end_fill()t.color("black")
t.pu()
t.seth(90)
t.fd(12)
t.seth(0)
t.fd(-3)
t.pd()
t.begin_fill()
t.circle(3)
t.end_fill()#腮
t.color((255,155,192))
t.pu()
t.seth(90)
t.fd(-95)
t.seth(0)
t.fd(65)
t.pd()
t.begin_fill()
t.circle(30)
t.end_fill()#嘴
t.color(239,69,19)
t.pu()
t.seth(90)
t.fd(15)
t.seth(0)
t.fd(-100)
t.pd()
t.seth(-80)
t.circle(30,40)
t.circle(40,80)#身体
t.color("red",(255,99,71))
t.pu()
t.seth(90)
t.fd(-20)
t.seth(0)
t.fd(-78)
t.pd()
t.begin_fill()
t.seth(-130)
t.circle(100,10)
t.circle(300,30)
t.seth(0)
t.fd(230)
t.seth(90)
t.circle(300,30)
t.circle(100,3)
t.color((255,155,192),(255,100,100))
t.seth(-135)
t.circle(-80,63)
t.circle(-150,24)
t.end_fill()#手
t.color((255,155,192))
t.pu()
t.seth(90)
t.fd(-40)
t.seth(0)
t.fd(-27)
t.pd()
t.seth(-160)
t.circle(300,15)
t.pu()
t.seth(90)
t.fd(15)
t.seth(0)
t.fd(0)
t.pd()
t.seth(-10)
t.circle(-20,90)t.pu()
t.seth(90)
t.fd(30)
t.seth(0)
t.fd(237)
t.pd()
t.seth(-20)
t.circle(-300,15)
t.pu()
t.seth(90)
t.fd(20)
t.seth(0)
t.fd(0)
t.pd()
t.seth(-170)
t.circle(20,90)#脚
t.pensize(10)
t.color((240,128,128))
t.pu()
t.seth(90)
t.fd(-75)
t.seth(0)
t.fd(-180)
t.pd()
t.seth(-90)
t.fd(40)
t.seth(-180)
t.color("black")
t.pensize(15)
t.fd(20)t.pensize(10)
t.color((240,128,128))
t.pu()
t.seth(90)
t.fd(40)
t.seth(0)
t.fd(90)
t.pd()
t.seth(-90)
t.fd(40)
t.seth(-180)
t.color("black")
t.pensize(15)
t.fd(20)#尾巴
t.pensize(4)
t.color((255,155,192))
t.pu()
t.seth(90)
t.fd(70)
t.seth(0)
t.fd(95)
t.pd()
t.seth(0)
t.circle(70,20)
t.circle(10,330)
t.circle(70,30)
t.done()
  • 具体注释都在源码里
  • 大家可边学习,边游玩
  • 若想知道更多游戏,欢迎来访我的博客
  • python游戏源码——1.贪吃蛇
  • python源码——2绘画简易坦克
  • python要点——干货

python画板——小猪佩奇相关推荐

  1. python画猪头_使用Python画小猪佩奇 社会人标配

    看了一些用python实现小猪佩奇画画的帖子,向自己实现下,以此记录. 社会人的标配是谁,当然是吹风机小猪佩奇身上纹. 我自己尝试画过小猪配齐但是感觉眼睛特别难画,画出来的猪头没有立体感,眼睛画不好整 ...

  2. python画图小猪佩奇_python 画个小猪佩奇

    不知道大家小时候有没有学习过logo语言,就是操纵一只小王八,来画各种图案.博主小学微机课就学习了这个,最近发现python的turtle包就是logo语言,所以画个小猪佩奇和大家分享. 代码来自知乎 ...

  3. 带你用python利用小猪佩奇制作四个小游戏

    本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理 以下文章来源于腾讯云 作者:Python进阶者 ( 想要学习Python?Pyth ...

  4. 用python画小猪佩奇的编码_如何用python绘制小猪佩奇-python绘图教程图文讲解

    原标题:如何用python绘制小猪佩奇-python绘图教程图文讲解 如何运用python来绘制小猪佩奇呢?通过几道简单的python代码即可让你绘制出小猪佩奇,话不多说,直接上代码. 用python ...

  5. 用python画小猪佩奇动画片全集_教你用Python画小猪佩奇

    刚过去几个月大家票圈肯定都被"小猪佩奇"."社会人"等字样刷屏了,不知道啥时候开始小猪佩奇成立社会人的标志,我说不出个所以然.但是相信很多人和我一样没有看过这系 ...

  6. python画图小猪佩奇_吊炸天!Python 20秒画出小猪佩奇

    原标题:吊炸天!Python 20秒画出小猪佩奇 今年社交平台上的带货女王是谁?范冰冰?杨幂?Angelababy?不,是猪猪女孩小猪佩奇. 小猪佩奇在构图基本是各种曲线,类抛物线.类圆.类椭圆.类二 ...

  7. 用Python 画小猪佩奇

    观察这个图像可以发现,小猪佩奇在构图基本是各种曲线,类抛物线.类圆.类椭圆.类二次贝塞尔曲线.这里说的都是"类",这也正是小猪佩奇的构图精髓,一种手绘风格,而不是标准刻板的线条.在 ...

  8. 海龟作图python小猪佩奇_有空学一学用Python画小猪佩奇

    本文来源于公众号恋习python,已经授权发布,大家可以关注下. 昨天, 被<啥是佩奇>这支广告片刷屏了. 佩奇明明是个喜剧角色, 却看哭了所有人. ▼ <啥是佩奇>??? 快 ...

  9. python写小猪佩奇_这个程序员用 Python 20 秒画完小猪佩奇“社会人”!

    点击上方"CSDN",选择"置顶公众号" 关键时刻,第一时间送达! 作者 | 丁彦军 责编 | 唐小引 每天写代码的程序员,你们知道今年社交平台上最火的带货女王 ...

最新文章

  1. LeetCode刷题-3
  2. 聚焦第三届世界智能大会|大佬们讲了哪些干货?
  3. Java多线程编程的常见陷阱
  4. Intel Realsense D435 如何通过图像识别出的比例点(x, y)获得实际点相对于摄像机原点的三维坐标(x, y, z)?
  5. Web Services简单介绍
  6. csv文件怎么转成excel_怎么把word转成excel
  7. rest模式get,post,put,delete简单讲解
  8. linux启动mysql_Linux服务器安装Mysql教程
  9. Python 并行编程
  10. c++代码健壮性_复活Navex-使用图查询进行代码分析(上)
  11. windows安装多个jdk版本的切换问题
  12. [Prescan] Prescan与Simulink联合
  13. dialogArguments的用法
  14. VBA读excel写xml
  15. 2012年全国医院排名(转)
  16. 如何压缩jpg图片的大小,操作简单的两个方法都教给你。
  17. 列联表与独立性检验(一维列联表 二维列联表 三维列联表 ; 卡方检验 Fisher精确检验 Cochran-Mantel-Haenszel检验)
  18. 阿里云国际版账户登录不上去什么原因?
  19. oracle timeatamp,oracle12c_Temporal Validity
  20. 陷阱技术探秘 ----动态汉化Windows技术的分析

热门文章

  1. 集装箱号码OCR识别SDK在港口理货系统中的应用
  2. 阿里云国际站的对象存储oss与自建存储的区别
  3. Python函数返回多个值的方法
  4. 秦储一行拜访陕西省文联和陕西新华出版传媒集团
  5. 网站图标开发指南(精)
  6. 中国医学影像工作站市场趋势报告、技术动态创新及市场预测
  7. java的jdk安装教程附百度网盘链接环境配置遇到的各种问题版本选择
  8. springboot+vue酒店电子商务平台
  9. SIM7600使用TCP连接服务器
  10. 2019,我的影像记录