Game Maker Language リファレンス > 組み込み関数 用途別 > サウンド > audio_pause_music
BGMを再生します(非推奨)
audio_play_music(index, loop);
注意! この関数は非推奨です。代わりにaudio_play_sound()を使用してください。
This function can be used to start a piece of background music playing. You can only have one piece of background playing at a time when using this function, and starting a sound while a previous one is playing will end the previous one directly. You can also choose whether the sound should loop back to the beginning by setting the loop flag to true, or only to play once by setting it to false.
if !global.Music { audio_stop_music(); } else { audio_play_music(snd_MusicIntro, true); }
The above code checks the global variable "Music" and if it returns false, it will stop all background music that is currently playing, and if it returns true, it will loop the music indexed in the variable "snd_MusicIntro".