闪闪金光圈_sprites多线程版

李兴球Python闪闪金光圈sprites多线程版

李兴球Python闪闪金光圈sprites多线程版


本程序制作一个金光闪闪的圈子,以下是完整源代码:

"""
   闪闪金光圈_sprites多线程版
"""

from sprites import *
from threading import Thread

def shinning():
    clock = Clock()
    r = Sprite('金光圈.png')
    while True:
       for s in range(1,10):
           r.scale(s)
           clock.tick(30)
        
screen = Screen()

for _ in range(6):
    time.sleep(0.1)
    Thread(target=shinning).start()

screen.mainloop()
    

关于李兴球

李兴球的博客是Python创意编程原创博客
此条目发表在python, sprites, turtle分类目录,贴了, , , 标签。将固定链接加入收藏夹。

发表回复