Compare commits

..

No commits in common. "b7ec46493ed120531029b73a12567f56e2a98cd1" and "061e311cf66c2062aad65dbcc3ef0e753b0bc49c" have entirely different histories.

4 changed files with 7 additions and 25 deletions

1
.gitignore vendored
View file

@ -1,3 +1,2 @@
/target
.cargo
/web

Binary file not shown.

View file

@ -1,12 +1,8 @@
use bevy::{ecs::system::SystemParam, prelude::*};
use bevy_kira_audio::prelude::*;
use crate::{
core::{
use crate::core::{
kirby::Kirby,
wave::{BubbleWaves, EnnemyWaveLock},
},
juice::sound::{Background, Poyoo},
};
#[derive(Event)]
@ -14,7 +10,7 @@ pub struct EndGameEvent {
pub reason: EndGameReason,
}
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug)]
pub enum EndGameReason {
Die,
Victory,
@ -73,22 +69,9 @@ fn on_reset_world(
#[derive(Event)]
struct ResetWorldEvent;
fn on_end_game(
event: On<EndGameEvent>,
mut commands: Commands,
background_audio: Res<AudioChannel<Background>>,
poyo_audio: Res<AudioChannel<Poyoo>>,
asset_server: Res<AssetServer>,
) {
fn on_end_game(event: On<EndGameEvent>, mut commands: Commands) {
let reason = event.reason;
println!("end game reason {:?}", reason);
if reason == EndGameReason::Victory {
background_audio.stop();
poyo_audio.play(asset_server.load("sounds/kirby-poyo.ogg"));
background_audio.play(asset_server.load("sounds/end_goffy.ogg"));
return;
}
commands.trigger(ResetWorldEvent);
}

View file

@ -89,8 +89,8 @@ fn get_bubble_waves() -> BubbleWaves {
],
vec![
BubbleSplash::new(NORMAL_BUBBLE, RIGHT - UP_DIR * 20.0, 100.0, 200),
BubbleSplash::new(RED_BUBBLE, RIGHT + TOP, 100.0, 100),
BubbleSplash::new(RED_BUBBLE, LEFT + TOP, 100.0, 100),
BubbleSplash::new(RED_BUBBLE, RIGHT + UP_DIR * 20.0, 100.0, 100),
BubbleSplash::new(RED_BUBBLE, LEFT, 100.0, 100),
],
vec![
BubbleSplash::new(NORMAL_BUBBLE, RIGHT, 100.0, 200),