Compare commits
No commits in common. "b7ec46493ed120531029b73a12567f56e2a98cd1" and "061e311cf66c2062aad65dbcc3ef0e753b0bc49c" have entirely different histories.
b7ec46493e
...
061e311cf6
4 changed files with 7 additions and 25 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,3 +1,2 @@
|
||||||
/target
|
/target
|
||||||
.cargo
|
.cargo
|
||||||
/web
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,12 +1,8 @@
|
||||||
use bevy::{ecs::system::SystemParam, prelude::*};
|
use bevy::{ecs::system::SystemParam, prelude::*};
|
||||||
use bevy_kira_audio::prelude::*;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::core::{
|
||||||
core::{
|
|
||||||
kirby::Kirby,
|
kirby::Kirby,
|
||||||
wave::{BubbleWaves, EnnemyWaveLock},
|
wave::{BubbleWaves, EnnemyWaveLock},
|
||||||
},
|
|
||||||
juice::sound::{Background, Poyoo},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Event)]
|
#[derive(Event)]
|
||||||
|
|
@ -14,7 +10,7 @@ pub struct EndGameEvent {
|
||||||
pub reason: EndGameReason,
|
pub reason: EndGameReason,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
pub enum EndGameReason {
|
pub enum EndGameReason {
|
||||||
Die,
|
Die,
|
||||||
Victory,
|
Victory,
|
||||||
|
|
@ -73,22 +69,9 @@ fn on_reset_world(
|
||||||
#[derive(Event)]
|
#[derive(Event)]
|
||||||
struct ResetWorldEvent;
|
struct ResetWorldEvent;
|
||||||
|
|
||||||
fn on_end_game(
|
fn on_end_game(event: On<EndGameEvent>, mut commands: Commands) {
|
||||||
event: On<EndGameEvent>,
|
|
||||||
mut commands: Commands,
|
|
||||||
background_audio: Res<AudioChannel<Background>>,
|
|
||||||
poyo_audio: Res<AudioChannel<Poyoo>>,
|
|
||||||
asset_server: Res<AssetServer>,
|
|
||||||
) {
|
|
||||||
let reason = event.reason;
|
let reason = event.reason;
|
||||||
println!("end game reason {:?}", 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);
|
commands.trigger(ResetWorldEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,8 +89,8 @@ fn get_bubble_waves() -> BubbleWaves {
|
||||||
],
|
],
|
||||||
vec![
|
vec![
|
||||||
BubbleSplash::new(NORMAL_BUBBLE, RIGHT - UP_DIR * 20.0, 100.0, 200),
|
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, RIGHT + UP_DIR * 20.0, 100.0, 100),
|
||||||
BubbleSplash::new(RED_BUBBLE, LEFT + TOP, 100.0, 100),
|
BubbleSplash::new(RED_BUBBLE, LEFT, 100.0, 100),
|
||||||
],
|
],
|
||||||
vec![
|
vec![
|
||||||
BubbleSplash::new(NORMAL_BUBBLE, RIGHT, 100.0, 200),
|
BubbleSplash::new(NORMAL_BUBBLE, RIGHT, 100.0, 200),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue