From dc56b5fc6d7d29924ecb140486671e3734ef91b7 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Mon, 3 Apr 2023 11:56:27 -0500 Subject: [PATCH] Support randomized footsteps. --- src/sound/footstep.rs | 93 ++++++++++++++++++++++++++++++++++--------- src/sound/mod.rs | 2 +- 2 files changed, 75 insertions(+), 20 deletions(-) diff --git a/src/sound/footstep.rs b/src/sound/footstep.rs index 5f50519..1301b07 100644 --- a/src/sound/footstep.rs +++ b/src/sound/footstep.rs @@ -1,14 +1,14 @@ use std::collections::HashMap; use bevy::{prelude::*, transform::TransformSystem}; -use bevy_synthizer::{Audio, Sound}; -use rand::random; +use bevy_synthizer::{Audio, Buffer, Sound}; +use rand::prelude::*; use crate::core::PointLike; #[derive(Component, Clone, Debug)] pub struct Footstep { - pub audio: Audio, + pub audio: Option