猫史档案馆


plane动画 ( Microflase教程 )

用户:04235453850423545385查看:0 回复:0 评论:0 创建时间:2021-06-26T14:57:48


首先打开MicroPython库

from microbit import *

创建动画几个造型的列表

[Image('00090:09090:99999:09090:00090'), Image('00900:90900:99990:90900:00900'), Image('09000:09000:99900:09000:09000'), Image('90000:90000:99000:90000:90000'), Image('00000:00000:90000:00000:00000'), Image('00000:00000:00000:00000:00000')]

加上动画,间隔75ms(0.075s),保持等待,循环播放,不清空屏幕

display.show([Image('00090:09090:99999:09090:00090'), Image('00900:90900:99990:90900:00900'), Image('09000:09000:99900:09000:09000'), Image('90000:90000:99000:90000:90000'), Image('00000:00000:90000:00000:00000'), Image('00000:00000:00000:00000:00000')], delay=75, wait=True, loop=True, clear=False)

运行程序,检查

发现有一点矛盾,飞机刚飞走了,又整个儿出现了,没关系,再加几个造型(仅显示列表)

display.show([Image('00090:09090:99999:09090:00090'), Image('00900:90900:99990:90900:00900'), Image('09000:09000:99900:09000:09000'), Image('90000:90000:99000:90000:90000'), Image('00000:00000:90000:00000:00000'), Image('00000:00000:00000:00000:00000'), Image('00000:00000:00009:00000:00000'), Image('00000:00009:00099:00009:00000'), Image('00000:00090:00999:00090:00000'), Image('00009:00909:09999:00909:00009')]

好的,这个程序就编写完了,看看完整代码吧

from microbit import *


display.show([Image('00090:09090:99999:09090:00090'), Image('00900:90900:99990:90900:00900'), Image('09000:09000:99900:09000:09000'), Image('90000:90000:99000:90000:90000'), Image('00000:00000:90000:00000:00000'), Image('00000:00000:00000:00000:00000'), Image('00000:00000:00009:00000:00000'), Image('00000:00009:00099:00009:00000'), Image('00000:00090:00999:00090:00000'), Image('00009:00909:09999:00909:00009')], delay=75, wait=True, loop=True, clear=False)

不会代码也不要着急,直接上积木center_image坐着却赞,给下面几个作品点赞吧

https://shequ.codemao.cn/work/104747841

https://shequ.codemao.cn/work/105354542

 

emotion_泪


回复

上一页1 页 / 共 0下一页