視訊檢視網址:
http://www.lixingqiu.com/2019/12/31/%e6%9c%88%e6%bb%a1%e8%a5%bf%e6%a5%bcmv/
"""
月滿西樓mv.py
本程式是一幅多媒體動畫.
"""
__author__ = "李興球"
__date__ = "2019年12月26日"
import time,os
from sprites import *
class Star(Sprite):
def __init__(self,x,y):
Sprite.__init__(self,shape='star',visible=False,pos=(x,y))
self.cs = ['gray','white']
self.se = [0.15,0.16]
self.index = 0
self.show()
self.flash()
def flash(self):
"""閃爍"""
self.index = 1 - self.index
self.color(self.cs[self.index])
self.scale(self.se[self.index])
t = random.randint(800,1200)
self.screen.ontimer(self.flash,t)
project_name = '月滿西樓'
width,height = 600,600
screen = Screen()
screen.bgcolor('dodger blue')
screen.setup(width,height)
screen.title(project_name)
screen.bgpic('荷塘月夜-唯美浪漫.png')
cors = [(0,250),(100,230),(-100,230),(-10,20),(30,50),(150,150),
(-200,10),(-150,150),(-100,90),(250,130),(220,220),(100,90)]
for x,y in cors:Star(x,y)
# 顯示標題,在一定時間後會自動清除
w = Sprite(visible=False,shape='title0.png')
w.addy(250)
w.stamp(60)
w.shape('title1.png')
w.addy(-220)
w.stamp(60)
tom = Turtle(visible=False)
tom.color("blue","white")
song_file="鄧麗君-月滿西樓.wav" # 歌曲檔案
lrc_file="月滿西樓歌詞.txt" # 歌詞檔案
fontstyle = ("",24,"normal")
tom.play(song_file,lrc_file,fontstyle)
screen.mainloop()
本作品採用《CC 協議》,轉載必須註明作者和本文連結