Initial web support

This commit is contained in:
Alex Page 2022-02-04 19:09:59 -05:00
parent 4cd9f5acc3
commit cbcda28719
17 changed files with 238 additions and 143 deletions

View file

@ -1,4 +1,5 @@
use std::time::{Duration, Instant};
use instant::Instant;
use std::time::Duration;
use bracket_lib::prelude::*;
use hecs::{Entity, World};
@ -77,15 +78,16 @@ pub fn run(world: &mut World, resources: &mut Resources) {
}
if wants_to_whip.frame == 7 {
wants_to_whip.sound = None;
resources
.sound_output
.play_sound(resources.sound_effects.whipping_hit_end.clone());
} else {
wants_to_whip.sound = Some(
resources
.sound_output
.play_sound(resources.sound_effects.whipping_hit.clone()),
);
if let (Some(sound_effects), Some(sound_output)) =
(&mut resources.sound_effects, &mut resources.sound_output)
{
sound_output.play_sound(sound_effects.whipping_hit_end.clone());
}
} else if let (Some(sound_effects), Some(sound_output)) =
(&mut resources.sound_effects, &mut resources.sound_output)
{
wants_to_whip.sound =
Some(sound_output.play_sound(sound_effects.whipping_hit.clone()));
}
}
}