Implement hitstun and knockback.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use bevy::prelude::*;
|
||||
use strum_macros::EnumIter;
|
||||
|
||||
use crate::fighter::{FighterFacingDirection, FighterVisual};
|
||||
use crate::fighter::{FighterFacingDirection, FighterHitstop, FighterVisual};
|
||||
|
||||
/// The simulation-owned animation clock. Rendering may interpolate freely, but
|
||||
/// gameplay samples baked data only with this rollback-tracked value.
|
||||
@@ -32,9 +32,13 @@ impl FighterAnimationFrame {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn advance_fighter_animation_frames(mut fighters: Query<&mut FighterAnimationFrame>) {
|
||||
for mut animation in &mut fighters {
|
||||
animation.advance();
|
||||
pub fn advance_fighter_animation_frames(
|
||||
mut fighters: Query<(&mut FighterAnimationFrame, &FighterHitstop)>,
|
||||
) {
|
||||
for (mut animation, hitstop) in &mut fighters {
|
||||
if hitstop.remaining_frames == 0 {
|
||||
animation.advance();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +85,9 @@ pub enum AnimKind {
|
||||
Fall,
|
||||
Turn,
|
||||
|
||||
FlinchGround,
|
||||
FlinchAir,
|
||||
|
||||
// Attacks
|
||||
AttackJab1,
|
||||
AttackUpTilt,
|
||||
|
||||
Reference in New Issue
Block a user