From bfc283603ff9fc48b2dff3673a56f7ad481e1031 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 14:08:44 +0400 Subject: feat(player): play footsteps on ground and building floors Select the original step effects from the hero's Control rows. A footfall follows the accepted movement and the camera rhythm. The Firing Range window starts the ground sound on the step and stays quiet when the player stops. --- apps/fparkan-game/src/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'apps/fparkan-game/src/main.rs') diff --git a/apps/fparkan-game/src/main.rs b/apps/fparkan-game/src/main.rs index f06b5d05..6a1a046a 100644 --- a/apps/fparkan-game/src/main.rs +++ b/apps/fparkan-game/src/main.rs @@ -20,6 +20,7 @@ mod mission_notices; mod mission_pause; mod player_collision; mod player_fire; +mod player_footsteps; mod projectile_render; mod projectile_trail; mod shield_effects; @@ -9822,6 +9823,10 @@ fn run_static_vulkan_mode( } app.demo_camera = demo_camera; app.cockpit = cockpit; + if let Some((engine, cockpit)) = app.mission_engine.as_ref().zip(cockpit) { + app.player_footsteps = + player_footsteps::PlayerFootsteps::load(root, engine, cockpit).unwrap_or_default(); + } app.player_weapon_layouts = player_weapon_layouts; if let Some(cockpit) = cockpit { let layout = &app.player_weapon_layouts[&cockpit.object_index]; @@ -10016,6 +10021,7 @@ struct StaticVulkanApp { projectile_draws: Vec>, autodemo_draws: Vec>, autonomous_shot_sounds: Vec>, + player_footsteps: player_footsteps::PlayerFootsteps, destruction_effects: Option, shield_effects: Option, player_fire_held: bool, @@ -10165,6 +10171,7 @@ impl StaticVulkanApp { projectile_draws: Vec::new(), autodemo_draws: Vec::new(), autonomous_shot_sounds: Vec::new(), + player_footsteps: Default::default(), destruction_effects: None, shield_effects: None, player_fire_held: false, @@ -11276,6 +11283,9 @@ impl StaticVulkanApp { self.present_mission_notice(notice, control_clock_ms); } if let Some(audio) = self.audio.as_mut() { + if let Some(footstep) = frame.player_footstep { + self.player_footsteps.play(audio, footstep); + } shot_sound::play_autonomous( &self.autonomous_shot_sounds, &frame.autodemo_combat_events, -- cgit v1.2.3