python奥特曼打怪兽多媒体演示动画,订制python游戏

本程序演示以下gif动画:
python奥特曼打怪兽多媒体演示动画,订制python游戏,图像帧已经通过python拆分好了

"""python奥特曼打怪兽多媒体演示动画,订制python游戏,图像帧已经通过python拆分好了"""

from turtle import *
from time import sleep
import os
from winsound import PlaySound,SND_ASYNC

background_image=[] 
music_file= "迪迦奥特曼主题曲.wav"
PlaySound(music_file, SND_ASYNC) # 异步播放音效
ultraman_path= os.getcwd() + "\\奥特曼动画帧"

screen=Screen()
screen.bgcolor("black")
screen.title("python奥特曼打怪兽多媒体演示动画www.lixingqiu.com")

for i in range(23):
    # fileName = "0" * (4-len(str(i))) + str(i) + ".png"
    file_name = f"{ultraman_path}{os.sep}{i:04d}.png"
    background_image.append(file_name)

index=0
while True:
    bg = background_image[index]
    screen.bgpic(bg)            # 切换背景图像 
    index=index + 1             # 索引加上个一
    index=index % 23            # 对数量取余数
    sleep(0.1)                  #   延时零点秒 
    screen.update()             # 更新屏幕显示