马儿跑起来多帧造型

马儿跑起来多帧造型

python马儿跑多帧图

李兴球Python马儿跑gameturtle多帧动画


"""
    马儿跑起来.py
    本程序需要gameturtle模块支持,安装方法
    pip install gameturtle
"""
from gameturtle import *

root = Tk()                          # 新建窗口
root.title('马儿跑起来_gameturtle多帧动画')
cv = Canvas(bg='white')              # 新建画布 
cv.pack()                            # 铺上画布

images = [f"{i}.png" for i in range(15)]
frames = [Image.open(im) for im in images]

sp = Sprite(cv,frames)
while 1:
    sp.nextshape() 
    cv.update()                      # 更新画布
    time.sleep(0.1)                  # 等待0.1秒

python马儿跑多帧图

李兴球

李兴球的博客是Python创意编程原创博客