我正在制作一个游戏,我需要标题屏幕音乐。我添加了所有的代码,它不会停止播放,它只是重新启动音乐。我该如何解决这个问题?
我试过使用repeat until块,但它仍然不起作用,它只是等到音乐结束后就停止了。
播放按钮代码:
when this sprite clicked
start sound coin
broadcast game
repeat 10
change ghost effect by 10
end of repeat block
hide背景代码:
when i receive game
repeat 10
change ghost effect by 10
end of repeat block
switch backdrop to gamewhen backdrop switches to game
repeat 10
change ghost effect by -10
end of repeat block
forever play sound music until done我预计输出会停止标题屏幕上的音乐,但当前的输出是重新启动音乐,然后在结束时停止。
发布于 2019-09-13 06:20:07
在音乐部分,有一个叫做“停止所有声音”的区块。
使用此块停止所有声音,但在停止所有声音之前添加0.3秒的延迟,这样它就不会在下面的永久循环中停止声音。
发布于 2019-10-02 20:44:24
您可能希望将代码更改为:
when backdrop switches to game
repeat 10
change ghost effect by -10
end of repeat block
forever play sound music until done
stop all sounds
stop this script停止所有的声音将歌曲,停止此脚本将使循环停止
https://stackoverflow.com/questions/57763605
复制相似问题