X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_audio.h;fp=player_audio.h;h=727080cea20c36bc5cf93d996d2aa94436cdeeaa;hb=23a1be081ab9e378cba49a23b8ed4d4082b580c1;hp=50616048156b1e71978ca657c25a62c0a328b178;hpb=1f0e3292c021e8263716e5f4544a1efcedf3f03d;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_audio.h b/player_audio.h index 5061604..727080c 100644 --- a/player_audio.h +++ b/player_audio.h @@ -127,8 +127,28 @@ VG_STATIC void player_audio(void) audio_player_set_flags( &audio_player_extra, AUDIO_FLAG_SPACIAL_3D ); audio_player_set_position( &audio_player_extra, phys->rb.co ); audio_player_set_vol( &audio_player_extra, 6.0f ); - audio_player_playclip( &audio_player_extra, - &audio_footsteps[rand()%4] ); + + if( player.surface_prop == k_surface_prop_concrete ) + { + audio_player_playclip( + &audio_player_extra, + &audio_footsteps[rand()%vg_list_size(audio_footsteps)] + ); + } + else if( player.surface_prop == k_surface_prop_grass ) + { + audio_player_playclip( + &audio_player_extra, + &audio_footsteps_grass[rand()%vg_list_size(audio_footsteps_grass)] + ); + } + else if( player.surface_prop == k_surface_prop_wood ) + { + audio_player_playclip( + &audio_player_extra, + &audio_footsteps_wood[rand()%vg_list_size(audio_footsteps_wood)] + ); + } } player.step_phase = walk_phase;