+
+
+ int walk_phase = 0;
+ if( vg_fractf(w->walk_timer) > 0.5f )
+ walk_phase = 1;
+ else
+ walk_phase = 0;
+
+ if( (w->step_phase != walk_phase) &&
+ (w->state.activity == k_walk_activity_ground ) )
+ {
+ audio_lock();
+ if( w->surface == k_surface_prop_concrete ){
+ audio_oneshot_3d(
+ &audio_footsteps[rand()%vg_list_size(audio_footsteps)],
+ player->rb.co, 40.0f, 1.0f
+ );
+ }
+ else if( w->surface == k_surface_prop_grass ){
+ audio_oneshot_3d(
+ &audio_footsteps_grass[rand()%vg_list_size(audio_footsteps_grass)],
+ player->rb.co, 40.0f, 1.0f
+ );
+ }
+ else if( w->surface == k_surface_prop_wood ){
+ audio_oneshot_3d(
+ &audio_footsteps_wood[rand()%vg_list_size(audio_footsteps_wood)],
+ player->rb.co, 40.0f, 1.0f
+ );
+ }
+ audio_unlock();
+ }
+
+ w->step_phase = walk_phase;