做了个飞机动画,带有声音的,飞机声音一会找不到,就用最原生的吧。源代码:
- from microbit import *
- plane1 = Image('00000:00000:00007:00000:00000')
- plane2 = Image('00000:00000:00077:00000:00000')
- plane3 = Image('00000:00007:00777:00007:00000')
- plane4 = Image('00007:00070:07777:00070:00007')
- plane5 = Image('00070:00505:77777:00505:00070')
- plane6 = Image('00700:07070:77770:07070:00700')
- plane7 = Image('07000:50500:77700:50500:07000')
- plane8 = Image('70000:07000:77000:07000:70000')
- plane9 = Image('00000:70000:70000:70000:00000')
- plane10 = Image('00000:00000:00000:00000:00000')
- Plane = [plane1,plane2,plane3,plane4,plane5,plane6,plane7,plane8,plane9,plane10]
- import speech
- while True:
- speech.say("the Plane is coming wengwengwengwengwengwengwengweng")
- display.show(Plane)
- sleep(2000)
复制代码
HEX文件如下:
microbit-plane.hex
(653.08 KB, 下载次数: 17)
此内容由EEWORLD论坛网友pqj325原创,如需转载或用于商业用途需征得作者同意并注明出处