亿万星辰 发表于 2012-3-11 12:23
文件名直接起名为Title1.MP3,Title2.MP3,Title3.MP3
Audio.bgm_play("Audio/BGM/Title#{rand(3)+1}.mp3") ...
class Scene_Title < Scene_Base
def play_title_music
a = Dir.entries("Audio/BGM")
l = [".","..","...","....",".....","......",".......","........"]
for e in l
a.delete(e)
end
b = a[rand(a.size)]
Audio.bgm_play("Audio/BGM/"+b)
end
end
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |