mirror of
https://github.com/thepigeongenerator/tetris_clone.git
synced 2025-12-17 05:55:46 +01:00
add place sound effect
This commit is contained in:
BIN
assets/place.wav
Normal file
BIN
assets/place.wav
Normal file
Binary file not shown.
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user