Day 45

Today I worked on the mute button.
I finally got a response on Reddit and someone told me to check out all the audio commands in Game Maker so I did. And apparently there is a command called audio_master_gain(); which you can set the gain for ALL the sounds (master). So i put that into my game code to set the master gain to 0 when i press the mute button, and it worked! Then I wanted to put the code inside the step event so I could have it so that when you press "M"  OR you press the left mouse button it would mute/unmute. So I made a variable called mouse_left and set its value to mouse_check_button_released(mb_left); and then I made a variable called key_m and set its value to keyboard_check_pressed(ord("M")); Then I added an "if" statement and said that if key_m or mouse_left return true then execute audio_master_gain(); and change the sprite to the muted sprite.

Tomorrow I might start finishing up my game by adding a new last level, working on sprites, and an end screen.

No comments:

Post a Comment