• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Changing Music

I have music that is on my title and it changes upon entering the game. How do I change the music that plays throughout the game when I get to the boss level?
My audio track is labelled a_boss

/// @description Begin the Game

if (keyboard_check_pressed (vk_space) and room ==r_title){
room_goto(r_boss);
audio_stop_sound(a_title);
audio_play_sound(a_game, 10, true);
}

//Change Music if on Main Screen too Long

if (!audio_is_playing(a_title) and !audio_is_playing(a_game)) {
audio_play_sound(a_game, 10, true);
}
 
I want to play a_game until I get to the boss room. Changing to a_boss in the code here plays a_boss in the rooms before the boss level. Did I miss understand your comment?
 
Say I have 5 rooms and then a boss Level. I want a_game to play until I reach the boss room. Then change to a_boss upon entering the boss room.
 

Nidoking

Member
Did I miss understand your comment?
Clearly. This line: audio_play_sound(a_game, 10, true); plays a_game. You do that when you want to play a_game. When you want to play something that is not a_game, you put the same line, but with whatever you want to play instead of a_game where it says a_game. The question to answer is: When do you want that to happen? Only don't tell me, because I am not the Game Maker runner and cannot play any sound resource. Tell the game when you want a_boss played, and tell it to play a_boss at that time. Now, you have said this:

when I get to the boss level?
How do you know that you're at the boss level? But phrase your answer in the form of an if statement using variables, and type it in Game Maker. Then type the line that plays a_boss when that condition is true. This is called "programming" and is a thing you need to do if you want to program a game.
 

kingyo

Member
Does "the boss level" mean the same thing as "the boss room"?
When you enter a normal room, start the normal BGM.
When you enter the boss room, stop the BGM that is playing and start the boss BGM.
 
Top