Commit a793a711 authored by Benjamin LEROUX's avatar Benjamin LEROUX

mute option

parent 61af3c7b
......@@ -70,6 +70,7 @@ static Sound fruitSound ;
static Sound goldenFruitSound;
static Sound deathSound;
static Music music;
static bool isMute;
......@@ -134,6 +135,7 @@ void InitGame(void)
snake[0].score=0;
gameOver = false;
pause = false;
isMute=false;
counterTail = 1;
......@@ -254,6 +256,14 @@ void UpdateGame(void)
{
if (IsKeyPressed('P')) pause = !pause;
//Mute on 'M' for azerty and qwerty keyboards
if (IsKeyPressed(59)||IsKeyPressed(KEY_M) ) {
isMute=!isMute;
if(isMute==true){
SetMasterVolume(0.0);
}else SetMasterVolume(1.0);
}
if (!pause)
{
UpdateMusicStream(music);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment