diff --git a/assets/sounds/player_sprint.wav b/assets/sounds/player_sprint.wav new file mode 100644 index 0000000..55163a4 Binary files /dev/null and b/assets/sounds/player_sprint.wav differ diff --git a/src/common/version.h b/src/common/version.h index 01f9006..681a1c5 100755 --- a/src/common/version.h +++ b/src/common/version.h @@ -4,7 +4,7 @@ /* Auto generated version file. DO NOT MODIFY */ #define SYMMETRY_VERSION_MAJOR 0 #define SYMMETRY_VERSION_MINOR 1 -#define SYMMETRY_VERSION_REVISION 343 +#define SYMMETRY_VERSION_REVISION 344 #define SYMMETRY_VERSION_BRANCH "dev" #endif \ No newline at end of file diff --git a/src/game/player.c b/src/game/player.c index bdd40b1..62fd945 100755 --- a/src/game/player.c +++ b/src/game/player.c @@ -242,14 +242,23 @@ void player_update_physics(struct Player* player, struct Scene* scene, float fix if(translation.x != 0.f || translation.z != 0.f) { - // Walking if(player->grounded) { - if(strncmp(player->footstep_sound->source_buffer->filename, "sounds/player_walk.wav", MAX_FILENAME_LEN) != 0) + // Sprinting/Walking + if(input_map_state_get("Sprint", KS_PRESSED)) + { + if(strncmp(player->footstep_sound->source_buffer->filename, "sounds/player_sprint.wav", MAX_FILENAME_LEN) != 0) + sound_source_buffer_set(sound, player->footstep_sound, "sounds/player_sprint.wav", ST_WAV); + } + else if(strncmp(player->footstep_sound->source_buffer->filename, "sounds/player_walk.wav", MAX_FILENAME_LEN) != 0) + { sound_source_buffer_set(sound, player->footstep_sound, "sounds/player_walk.wav", ST_WAV); + } if(sound_source_is_paused(sound, player->footstep_sound)) + { sound_source_play(sound, player->footstep_sound); + } } } else