ESC + music end
This commit is contained in:
1 parent
4bd0977bc7
commit
ee1c1aa717
1 file changed
+4
-1
@@ -439,6 +439,7 @@ void render(SDL_Window* win, SDL_Renderer* ren, Env* env) {
|
||||
/* **************************************************************** */
|
||||
|
||||
void play_Music(Env* env, bool lightbulb, bool error, bool mark) {
|
||||
if (!game_is_over(env->g)) {
|
||||
if (error && game_has_error_general_intero(env->g)) {
|
||||
Mix_PlayMusic(env->err_music[env->err_music_cpt % 3], 0);
|
||||
env->err_music_cpt++;
|
||||
@@ -449,6 +450,7 @@ void play_Music(Env* env, bool lightbulb, bool error, bool mark) {
|
||||
Mix_PlayMusic(env->mark_music[env->mark_music_cpt % 3], 0);
|
||||
env->mark_music_cpt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ToggleFullscreen(SDL_Window* Window) {
|
||||
@@ -525,7 +527,8 @@ bool process(SDL_Window* win, Env* env, SDL_Event* e, SDL_Event* prec_e, int* nb
|
||||
} else if (state[SDL_SCANCODE_Z]) { // (Z becuase sdl2 is in QWERTY) W to save the game in the file save.txt
|
||||
game_save(env->g, "save.txt");
|
||||
update_pressed(env, false, false, false, false, false, true);
|
||||
}
|
||||
} else if (state[SDL_SCANCODE_ESCAPE])
|
||||
return true;
|
||||
} else if (e->type == SDL_KEYUP) {
|
||||
update_pressed(env, false, false, false, false, false, false);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user