用户:
丨·o·丨查看:1 回复:2 评论:1 创建时间:2021-05-02T22:14:49
【作品展示】

【作品介绍】
介绍:我用turtle库画出来了火星车,火星和地球,让以中国神话传说中的火神命名的火星车登上了火星。操作:点击开始键,程序会自动绘画(点击后需稍等一段时间)
制作过程:我先进行了构思,然后在纸上画出了坐标轴,定好位置后就开始了编程,经过多次调试后达到了目标。
【作品源代码】
import turtle as t
t.fillcolor("grey")
t.penup()
t.goto(-500,400)
t.pendown()
t.begin_fill()
for i in range(2):
t.forward(1000)
t.right(90)
t.forward(800)
t.right(90)
t.end_fill()
t.penup()
t.pensize(5)
t.speed(0)
t.screensize(500,500)
t.goto(0,0)
t.pendown()
t.fillcolor("dark grey")
t.begin_fill()
for i in range(3):
t.forward(75)
t.left(90)
t.right(90)
for i in range(3):
t.forward(75)
t.left(90)
t.end_fill()
t.goto(-75,0)
t.fillcolor("black")
t.goto(-125,-25)
t.penup()
t.goto(-100,-50)
t.pendown()
t.begin_fill()
t.circle(25, 1000, 1000)
t.end_fill()
t.penup()
t.goto(0,0)
t.pendown()
t.goto(0,-25)
t.penup()
t.goto(5,-75)
t.pendown()
t.begin_fill()
t.circle(25, 370, 1000)
t.end_fill()
t.penup()
t.goto(75,0)
t.pendown()
t.goto(125,-25)
t.penup()
t.goto(130,-75)
t.pendown()
t.begin_fill()
t.circle(25, 370, 1000)
t.end_fill()
t.penup()
t.goto(-125,75)
t.pendown()
t.fillcolor("dark grey")
t.begin_fill()
t.goto(50,75)
t.goto(50,175)
t.right(30)
for i in range(2):
t.forward(50)
t.left(90)
t.forward(25)
t.left(90)
t.goto(70, 175)
t.goto(70,75)
t.goto(125,75)
t.end_fill()
t.penup()
t.pensize(2.5)
t.speed(0)
t.goto(-50, 70)
t.pendown()
t.goto(-45, 60)
t.penup()
t.goto(-50, 50)
t.pendown()
t.goto(-40, 50)
t.goto(-50, 30)
t.goto(-45, 40)
t.goto(-40, 30)
t.goto(-45, 40)
t.goto(-45, 20)
t.penup()
t.goto(-25,70)
t.pendown()
for i in range(2):
t.forward(20)
t.right(90)
t.forward(15)
t.right(90)
t.penup()
t.goto(-20,55)
t.pendown()
t.goto(-25,20)
t.penup()
t.goto(-10,55)
t.pendown()
t.goto(-10,20)
t.goto(0,20)
t.goto(0,30)
t.penup()
t.goto(10,70)
t.pendown()
t.goto(30,70)
t.penup()
t.goto(10,60)
t.pendown()
for i in range(2):
t.forward(20)
t.right(90)
t.forward(10)
t.right(90)
t.penup()
t.goto(5,25)
t.pendown()
t.goto(5,45)
t.goto(30,45)
t.goto(30,25)
t.goto(27.5,32.5)
t.penup()
t.goto(10,40)
t.pendown()
t.goto(15,35)
t.penup()
t.goto(25,40)
t.pendown()
t.goto(20,35)
t.goto(7.5,35)
t.goto(27.5,35)
t.penup()
t.goto(10,30)
t.pendown()
t.goto(25,30)
t.penup()
t.goto(17.5,35)
t.pendown()
t.goto(17.5,25)
t.penup()
t.goto(42.5,70)
t.pendown()
t.goto(42.5,25)
t.penup
t.goto(35,25)
t.pendown()
t.goto(50,30)
t.penup()
t.goto(47.5,32.5)
t.pendown()
t.goto(55,25)
t.penup()
t.goto(35,60)
t.pendown()
for i in range(2):
t.forward(20)
t.right(90)
t.forward(10)
t.right(90)
t.fillcolor("red")
t.penup()
t.goto(0,-1675)
t.pendown()
t.begin_fill()
t.pencolor("red")
t.circle(800,10000,10000)
t.end_fill()
t.penup()
t.goto(-300,300)
t.pendown()
t.pencolor("blue")
t.fillcolor("blue")
t.begin_fill()
t.circle(50,740,1000)
t.end_fill()
t.penup()
t.goto(99999,99999)
t.done()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn