![]() |
The NEW Pong Game V13.2.1
An interesting implemnettaion of the pong game
|
Utility class for handling sound effects and music in the game. More...
#include <sound_effects.hpp>
Static Public Member Functions | |
static void | change_music_track (Mix_Music *music_file, int fade_out_duration=500, int fade_in_duration=500, int volume=MIX_MAX_VOLUME/3) |
Changes background music with fade effect. | |
Utility class for handling sound effects and music in the game.
This class provides static methods for controlling audio playback, including background music transitions with fade effects.
|
static |
Changes background music with fade effect.
music_file | The new music track to play |
fade_out_duration | Duration of fade out in milliseconds |
fade_in_duration | Duration of fade in in milliseconds |
volume | Volume level (0-128) |
This function smoothly transitions from the current music track to a new one by fading out the current track, then fading in the new one. It also sets the volume level of the new track.
music_file | The new music track to play |
fade_out_duration | Duration of fade out in milliseconds |
fade_in_duration | Duration of fade in in milliseconds |
volume | Volume level (0-128) |