diff --git a/Cargo.lock b/Cargo.lock index 8f9565a..170b0d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -827,10 +827,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" dependencies = [ "cfg-if 1.0.0", - "js-sys", "libc", "wasi", - "wasm-bindgen", ] [[package]] @@ -1069,7 +1067,6 @@ dependencies = [ "bracket-lib", "console_error_panic_hook", "cpal", - "getrandom", "hecs", "instant", "oddio", diff --git a/Cargo.toml b/Cargo.toml index 6c96633..4d39a67 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,6 @@ console_error_panic_hook = "0.1.7" wasm-bindgen = "0.2.79" instant = "0.1.12" rand = "0.8.5" -getrandom = { version = "0.2.4", features = ["js"] } [target.'cfg(windows)'.build-dependencies] winres = "0.1.12" diff --git a/src/resources/sound_effects.rs b/src/resources/sound_effects.rs index 914b6b9..c3ae8c5 100644 --- a/src/resources/sound_effects.rs +++ b/src/resources/sound_effects.rs @@ -1,4 +1,4 @@ -use std::{cmp, iter, time::Duration}; +use std::{iter, time::Duration}; use bracket_lib::random::RandomNumberGenerator; @@ -44,7 +44,6 @@ pub struct SoundEffects { impl SoundEffects { pub fn new(sound_output: &SoundOutput) -> Self { - let mut rng = RandomNumberGenerator::new(); Self { startup: sound_output.render_sound_effect(&SoundEffect { sounds: (1..800) @@ -58,7 +57,7 @@ impl SoundEffects { sounds: vec![ Sound { sound_type: SoundType::Noise(350, 900), - duration: Duration::from_millis(5), + duration: Duration::from_millis(6), }, Sound { sound_type: SoundType::Silence, @@ -134,12 +133,12 @@ impl SoundEffects { }], }), whipping_hit_block: sound_output.render_sound_effect(&SoundEffect { - sounds: (20_i32..=5700_i32) + sounds: (20..=5700) .rev() - .step_by(5) + .step_by(100) .map(|x| Sound { - sound_type: SoundType::Tone(cmp::max(0, rng.range(0, x * 2) - x) as u32), - duration: Duration::from_micros(665), + sound_type: SoundType::Noise(0, x), + duration: Duration::from_millis(18), }) .collect(), }), @@ -191,7 +190,7 @@ impl SoundEffects { }) .collect(), }), - rng, + rng: RandomNumberGenerator::new(), } }