用户:
孤僻的蓝雀GCXp查看:0 回复:0 评论:0 创建时间:2021-05-05T17:37:07
【作品展示】

【作品介绍】
去太空,趣编程!!!
【作品源代码】
import turtle
pen = turtle.Pen()
pen.speed(0)
def star(x,y,angle):
pen.pencolor("yellow")
pen.penup()
pen.goto(x,y)
pen.pendown()
pen.fillcolor("yellow")
pen.begin_fill()
pen.setheading(angle)
for i in range(5):
pen.forward(50)
pen.right(150-i*3)
pen.end_fill()
#背景
pen.fillcolor("Darkblue")
pen.begin_fill()
pen.penup()
pen.goto(-385,-315)
pen.pendown()
for i in range(2):
pen.forward(765)
pen.left(90)
pen.forward(635)
pen.left(90)
pen.end_fill()
#下边
pen.penup()
pen.goto(-385,-100)
pen.pendown()
pen.fillcolor("skyblue")
pen.begin_fill()
for i in range(2):
pen.forward(765)
pen.right(90)
pen.forward(215)
pen.right(90)
pen.end_fill()
#星星
star(100,150,120)
star(30,-150,150)
star(61,24,0)
star(46,2喵,130)
star(-349,65,0)
star(-316,-39,197)
#飞船喵的火焰
pen.penup()
pen.goto(-200,50)
pen.pendown()
pen.fillcolor("red")
pen.begin_fill()
pen.setheading(340)
pen.forward(200)
pen.penup()
pen.goto(-170,40)
pen.pendown()
pen.setheading(240)
pen.forward(110)
pen.left(160)
pen.forward(80)
pen.right(150)
pen.forward(110)
pen.left(160)
pen.forward(130)
pen.right(140)
pen.forward(60)
pen.setheading(45)
pen.forward(90)
pen.end_fill()
#飞船船身
pen.fillcolor("white")
pen.begin_fill()
pen.penup()
pen.goto(-200,50)
pen.pendown()
pen.left(70)
pen.forward(50)
pen.setheading(340)
pen.forward(258)
pen.setheading(215)
pen.forward(45)
pen.end_fill()
pen.fillcolor("white")
pen.begin_fill()
pen.setheading(30)
pen.penup()
pen.goto(-220,95)
pen.pendown()
pen.forward(30)
pen.right(50)
pen.forward(220)
pen.right(50)
pen.forward(30)
pen.end_fill()
pen.penup()
pen.goto(-220,95)
pen.pendown()
pen.pencolor("skyblue")
pen.setheading(340)
pen.forward(260)
pen.penup()
pen.goto(-193,110)
pen.pendown()
pen.fillcolor("orange")
pen.begin_fill()
pen.pencolor("orange")
pen.setheading(50)
pen.forward(15)
pen.setheading(340)
pen.forward(210)
pen.setheading(270)
pen.forward(15)
pen.end_fill()
pen.pencolor("white")
pen.penup()
pen.goto(35,115)
pen.pendown()
pen.setheading(90)
pen.circle(110)
#星球
pen.pencolor("red")
pen.fillcolor("red")
pen.begin_fill()
pen.setheading(0)
pen.penup()
pen.goto(385,200)
pen.pendown()
pen.circle(115)
pen.end_fill()
pen.penup()
pen.goto(335,-100)
pen.pendown()
pen.setheading(0)
pen.fillcolor("chocolate")
pen.begin_fill()
pen.circle(50)
pen.end_fill()
pen.penup()
pen.goto(240, 270)
pen.pendown()
pen.fillcolor("silver")
pen.begin_fill()
pen.circle(15)
pen.end_fill()
pen.penup()
pen.goto(-365,210)
pen.pendown()
pen.fillcolor("pink")
pen.begin_fill()
pen.circle(10)
pen.end_fill()
pen.penup()
pen.goto(-300,98)
pen.pendown()
pen.fillcolor("salmon")
pen.begin_fill()
pen.circle(15)
pen.end_fill()
#流星
pen.penup()
pen.goto(385,100)
pen.pendown()
pen.fillcolor("gold")
pen.begin_fill()
pen.setheading(205)
pen.pencolor("gold")
pen.forward(150)
pen.penup()
pen.goto(385, 100)
pen.pendown()
pen.setheading(200)
pen.forward(150)
pen.penup()
pen.goto(385, 100)
pen.pendown()
pen.setheading(205)
pen.forward(150)
pen.setheading(120)
pen.forward(15)
pen.end_fill()
pen.fillcolor("gold")
pen.begin_fill()
pen.penup()
pen.goto(250,45)
pen.pendown()
pen.setheading(135)
pen.circle(20)
pen.end_fill()
pen.hideturtle()
turtle.done()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn