| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 5420 人关注过本帖
标题:用Turtle绘制新冠状病毒
只看楼主 加入收藏
ghz09
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2020-3-14
收藏
得分:0 
想加一个绿色触手的效果,但最后没有内部填充,望大佬指教

import turtle as t #将turtle库给予别名t
from random import randint

t.setup(800, 1000, 0, 0)
t.speed(0)
t.fillcolor("blue")#自定义颜色
# 病毒的外框
t.begin_fill()
t.pencolor("black")
for i in range(6):
    t.circle(200, 30)
    t.right(50)
    t.fd(100)
    t.left(90)
    t.circle(30, 30)
    t.forward(5)
    t.pencolor("green")
    t.fillcolor("green")
    t.begin_fill()
    t.circle(10)
    t.end_fill()
    t.fillcolor("blue")
    t.pencolor("black")
    t.left(45)
    t.fd(80)
    t.right(90)
    t.circle(15)
    t.fd(10)
    if i == 5:
        t.circle(200, 30)
t.end_fill()
# 病毒内里面的圆
t.fillcolor("gray")

for i in range(4):
    t.penup()
    t.left(90)
    if i == 0:
        t.fd(180)
    else:
        t.fd(randint(50, 100))  # 随机距离
    t.pendown()
    t.begin_fill()
    t.circle(12, 360)
    t.end_fill()
   
t.penup()
t.goto(100,300)
t.pendown()


t.write('新冠肺炎',font=("Arial",34,"normal"))
# 画框一直存在
t.done()

2020-03-17 10:41
ghz09
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2020-3-14
收藏
得分:0 
回复 8楼 木偶人丶
想加一个绿色触手效果,但内部无法填充,望大佬指教


import turtle as t #将turtle库给予别名t
from random import randint

t.setup(800, 1000, 0, 0)
t.speed(0)
t.fillcolor("blue")
# 病毒的外框
t.begin_fill()
t.pencolor("black")
for i in range(6):
    t.circle(200, 30)
    t.right(50)
    t.fd(100)
    t.left(90)
    t.circle(30, 30)
    t.forward(5)
    t.pencolor("green")
    t.fillcolor("green")
    t.begin_fill()
    t.circle(10)
    t.end_fill()
    t.fillcolor("blue")
    t.pencolor("black")
    t.left(45)
    t.fd(80)
    t.right(90)
    t.circle(15)
    t.fd(10)
    if i == 5:
        t.circle(200, 30)
t.end_fill()
# 病毒内里面的圆
t.fillcolor("gray")

for i in range(4):
    t.penup()
    t.left(90)
    if i == 0:
        t.fd(180)
    else:
        t.fd(randint(50, 100))  # 随机距离
    t.pendown()
    t.begin_fill()
    t.circle(12, 360)
    t.end_fill()
   
t.penup()
t.goto(100,300)
t.pendown()


t.write('新冠肺炎',font=("Arial",34,"normal"))
# 画框一直存在
t.done()

2020-03-17 10:45
木偶人丶
Rank: 2
等 级:论坛游民
帖 子:36
专家分:16
注 册:2017-3-3
收藏
得分:0 
回复 12楼 ghz09
我不是什么大佬,我也是刚学,可能帮不了你什么
2020-04-06 18:13
快速回复:用Turtle绘制新冠状病毒
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015105 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved