add place sound effect

This commit is contained in:
2025-03-25 11:26:12 +01:00
parent 293a211d55
commit 8bbcd29c56
4 changed files with 4 additions and 0 deletions

BIN
assets/place.wav Normal file

Binary file not shown.

View File

@@ -58,6 +58,7 @@ void game_init(gamedata* const dat) {
gt, // time gt, // time
ad, // audio_device ad, // audio_device
audio_wav_load(ad, "korobeiniki.wav"), // music audio_wav_load(ad, "korobeiniki.wav"), // music
audio_wav_load(ad, "place.wav"), // place_sfx
0, // timer_music 0, // timer_music
0, // timer_update 0, // timer_update
0, // timer_input 0, // timer_input

View File

@@ -27,6 +27,7 @@ typedef struct {
struct gametime time; struct gametime time;
audiodevice* audio_device; audiodevice* audio_device;
audiodata music; audiodata music;
audiodata place_sfx;
time_t timer_music; time_t timer_music;
time_t timer_update; time_t timer_update;
time_t timer_input; time_t timer_input;

View File

@@ -113,6 +113,8 @@ void place_update(gamedata* const game_data, input_data const move) {
set_shape(game_data->rows, curr_id, game_data->sel_x, game_data->sel_y); // if the shape intersects vertically, write the shape at the current position and return set_shape(game_data->rows, curr_id, game_data->sel_x, game_data->sel_y); // if the shape intersects vertically, write the shape at the current position and return
clear_rows(game_data->rows, &game_data->score); // clear the rows that have been completed clear_rows(game_data->rows, &game_data->score); // clear the rows that have been completed
audio_play(game_data->audio_device, &game_data->place_sfx);
next_shape(game_data); next_shape(game_data);
if (shape_intersects(game_data->rows, game_data->curr_idx, game_data->sel_x, game_data->sel_y)) if (shape_intersects(game_data->rows, game_data->curr_idx, game_data->sel_x, game_data->sel_y))
game_data->run = false; game_data->run = false;