""" 月满西楼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) 以下代码省略......
下载完整源代码与素材,请
需要浏览更多吗?
成为会员后,登陆才能继续浏览!联系微信scratch8即可办理会员。
(会员专属:能浏览所有文章,下载所有带链接的Python资源。)