arrow ability (#29)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
mod arrow;
|
||||
mod gun;
|
||||
mod thrown;
|
||||
|
||||
@@ -73,11 +74,14 @@ impl TriggerData {
|
||||
#[derive(Event, Reflect)]
|
||||
pub struct TriggerGun(pub TriggerData);
|
||||
#[derive(Event, Reflect)]
|
||||
pub struct TriggerArrow(pub TriggerData);
|
||||
#[derive(Event, Reflect)]
|
||||
pub struct TriggerThrow(pub TriggerData);
|
||||
|
||||
pub fn plugin(app: &mut App) {
|
||||
app.add_plugins(gun::plugin);
|
||||
app.add_plugins(thrown::plugin);
|
||||
app.add_plugins(arrow::plugin);
|
||||
|
||||
app.add_systems(Update, enemy_hit.run_if(in_state(GameState::Playing)));
|
||||
|
||||
@@ -155,7 +159,8 @@ fn on_trigger_state(
|
||||
match ability {
|
||||
HeadAbility::Thrown => commands.trigger(TriggerThrow(trigger_state)),
|
||||
HeadAbility::Gun => commands.trigger(TriggerGun(trigger_state)),
|
||||
_ => (),
|
||||
HeadAbility::Arrow => commands.trigger(TriggerArrow(trigger_state)),
|
||||
HeadAbility::None => (),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user