流星(误)

0

import turtle as t
from random import randint
import colorsys

t.shape('blank')
t.rt(135)
t.speed(0)
def coloradd(r,g,b):
      h,l,s = colorsys.rgb_to_hls(r,g,b)
      h = h + 0.01
      r,g,b = colorsys.hls_to_rgb(h,l,s)
      return r,g,b
t.bgcolor('black')

z = (1,0,0)

while True:
    t.delay(0)
    t.update()
    t.speed(0)
    s = randint(-600,600)
    d = randint(-500,500)
    t.pendown()
    for x in range(20):
        t.color(z)
        t.pensize(x + 1)
        t.fd(5)
        z = coloradd(z[0],z[1],z[2])
    t.penup()
    t.goto(s,d)


0

发表评论