diff --git a/assets/place.wav b/assets/place.wav new file mode 100644 index 0000000..67b8c48 Binary files /dev/null and b/assets/place.wav differ diff --git a/src/game/game.c b/src/game/game.c index aea012a..e200097 100644 --- a/src/game/game.c +++ b/src/game/game.c @@ -58,6 +58,7 @@ void game_init(gamedata* const dat) { gt, // time ad, // audio_device audio_wav_load(ad, "korobeiniki.wav"), // music + audio_wav_load(ad, "place.wav"), // place_sfx 0, // timer_music 0, // timer_update 0, // timer_input diff --git a/src/game/game.h b/src/game/game.h index f6c0614..4b42ab6 100644 --- a/src/game/game.h +++ b/src/game/game.h @@ -27,6 +27,7 @@ typedef struct { struct gametime time; audiodevice* audio_device; audiodata music; + audiodata place_sfx; time_t timer_music; time_t timer_update; time_t timer_input; diff --git a/src/game/tetromino/placing.c b/src/game/tetromino/placing.c index ab83bb4..2beec19 100644 --- a/src/game/tetromino/placing.c +++ b/src/game/tetromino/placing.c @@ -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 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); if (shape_intersects(game_data->rows, game_data->curr_idx, game_data->sel_x, game_data->sel_y)) game_data->run = false;