用python畫乙個小火箭

發布時間:2024-05-08 閱讀:1136

用python畫乙個小火箭,python原始碼如下:

import turtle as tu

tu.screen().bgcolor("white")

t=tu.turtle()

t.color("grey")

rk_blue="blue"

rk_red="red"

rk_yellow="yellow"

def go(x,y):

t.penup()

t.goto(x,y)

t.pendown()

x=-100

y=-200

go(x,y)

t.pensize(1)

t.fillcolor(rk_blue)

t.begin_fill()

for i in range(4):

t.left(90)

t.forward(15)

t.end_fill()

go(x,y+15)

t.pensize(1)

t.fillcolor(rk_red)

t.begin_fill()

for i in range(4):

t.left(90)

t.forward(15)

t.end_fill()

go(x,y+30)

t.pensize(1)

t.fillcolor(rk_blue)

t.begin_fill()

for i in range(4):

t.left(90)

t.forward(15)

t.end_fill()

go(x,y+45)

t.pensize(1)

t.fillcolor(rk_red)

t.begin_fill()

t.left(90)

t.forward(30)

t.left(90)

t.forward(15)

t.left(90)

t.forward(30)

t.left(90)

t.forward(15)

t.end_fill()

go(x+45,y)

t.pensize(1)

t.fillcolor(rk_blue)

t.begin_fill()

for i in range(4):

t.left(90)

t.forward(15)

t.end_fill()

go(x+45,y+15)

t.pensize(1)

t.fillcolor(rk_red)

t.begin_fill()

for i in range(4):

t.left(90)

t.forward(15)

t.end_fill()

go(x+45,y+30)

t.pensize(1)

t.fillcolor(rk_blue)

t.begin_fill()

for i in range(4):

t.left(90)

t.forward(15)

t.end_fill()

go(x+45,y+45)

t.pensize(1)

t.fillcolor(rk_red)

t.begin_fill()

t.left(90)

t.forward(30)

t.left(90)

t.forward(15)

t.left(90)

t.forward(30)

t.left(90)

t.forward(15)

t.end_fill()

go(x+90,y)

t.pensize(1)

t.fillcolor(rk_blue)

t.begin_fill()

for i in range(4):

t.left(90)

t.forward(15)

t.end_fill()

go(x+90,y+15)

t.pensize(1)

t.fillcolor(rk_red)

t.begin_fill()

for i in range(4):

t.left(90)

t.forward(15)

t.end_fill()

go(x+90,y+30)

t.pensize(1)

t.fillcolor(rk_blue)

t.begin_fill()

for i in range(4):

t.left(90)

t.forward(15)

t.end_fill()

go(x+90,y+45)

t.pensize(1)

t.fillcolor(rk_red)

t.begin_fill()

t.left(90)

t.forward(30)

t.left(90)

t.forward(15)

t.left(90)

t.forward(30)

t.left(90)

t.forward(15)

t.end_fill()

go(x,y+45)

t.pensize(1)

t.fillcolor(rk_yellow)

t.begin_fill()

t.forward(75)

t.left(90)

t.forward(140)

t.left(90)

t.forward(75)

t.left(90)

t.forward(140)

t.left(90)

t.end_fill()

go(x,y+110)

t.pensize(1)

t.fillcolor(rk_blue)

t.begin_fill()

t.forward(75)

t.left(90)

t.forward(20)

t.left(90)

t.forward(75)

t.left(90)

t.forward(20)

t.left(90)

t.end_fill()

go(x,y+150)

t.pensize(1)

t.forward(75)

go(x+19,y+160)

t.pensize(1)

t.fillcolor(rk_red)

t.begin_fill()

t.forward(38)

t.left(90)

t.forward(10)

t.left(90)

t.forward(38)

t.left(90)

t.forward(10)

t.left(90)

t.end_fill()

go(x,y+185)

t.pensize(1)

t.fillcolor(rk_yellow)

t.begin_fill()

t.forward(75)

t.left(120)

t.forward(75)

t.left(120)

t.forward(75)

t.left(120)

t.end_fill()

t.hideturtle()

tu.done()

惡搞漫畫 乙個沒有弱點的殺手? 它被摧毀了!

惡搞漫畫 乙個沒有弱點的殺手?它被摧毀了!作為一名殺手,古德總是能夠面對敵人而不被嚇倒。無論對手有多強,無論是否威脅生命。古德總是挺身而出,獨自面對一切困難和危險。從不害怕退縮。它總是那麼別緻和自由。作為一名殺手,古德沒有朋友,甚至沒有親戚。可以說,他根本就沒有死穴。這就是為什麼他不必擔心殺人的原因...

惡搞漫畫 理科生的恐怖! 一切都在計算中!

惡搞漫畫 理科生的恐怖!一切都在計算中!乙個男人外出逛街的時候,突然接到了他女神的 號碼,原來是他的女孩想讓男人來醫院看看,現在有急事要男人過來解決。我想這個女人解釋過了,原來剛才他和貝塔逛街的時候,那個男人突然直接暈了過去,這個女孩很害怕,覺得小李是他的好朋友,於是直接給小李打了個電話,讓她過來照...

你如何畫乙個哥德式人物? 快速畫出乙個哥德式女孩

你如何畫乙個哥德式人物?快速畫出乙個哥德式女孩你怎麼畫乙個哥德式女孩?我怎樣才能畫乙個哥德式女孩?畫乙個好的哥德式女孩有哪些技巧?想必這些都是繪畫初學者比較傷腦筋的問題,那麼你怎麼能畫好哥德式女孩配飾呢?光課 上有很多繪畫教程和繪畫資料,還有專業的繪畫課程,學畫畫的人可以去找很多有用的繪畫學習資源!...

20年的演藝生涯和15年的寫作生涯,雌雄同體的人活得最美!

林青霞近日現身經典作品 滾紅塵 首映式,這也是她離婚風波後的首次亮相,她給人乙個意想不到的答案,她說自己沒什麼錯,完美的婚姻怎麼能隨隨便拋棄,乙個不合適的人如果能在一起,早就在一起了。但就是這樣的事情,她認識到了這一點,她總是堅持做到最好。無論是婚姻 演戲,還是寫作 書法和繪畫。如今,人們喜歡談論時...

企業用整版感謝政府,創意還是奉承?

前天,終於又有一則報紙創意廣告。據 報道,月日,浙江省溫州市某企業在 溫州 刊登了整版廣告。在頁面上,謝謝 的字樣特別大,特別醒目,這則廣告在發布幾天後就被浙江 記者報道,引發熱議。據了解,選擇在報紙上刊登整版感謝信的是溫州市一家本土智慧型門鎖品牌企業,原因是溫州市甌海區在三天內為該企業辦理了相關審...