Implement hitstun and knockback.

This commit is contained in:
2026-09-13 23:01:25 +02:00
parent 811578af2f
commit 4570860d64
26 changed files with 840 additions and 246 deletions
+11 -4
View File
@@ -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,