Implement tap jump and clean some fluff (#83)
CI / build-and-test (push) Successful in 1m33s
CI / production-build (push) Successful in 11m45s

Reviewed-on: #83
Co-authored-by: Álex Román Núñez <eirexe@eirteam.moe>
This commit was merged in pull request #83.
This commit is contained in:
2026-10-05 15:01:31 +00:00
committed by EIREXE
parent d2d649b059
commit 5c277a00f0
5 changed files with 67 additions and 47 deletions
+13 -16
View File
@@ -1,6 +1,8 @@
use crate::fighter::state::jump::{JumpState, JumpType};
use crate::fighter::state::jump::{self};
use crate::fighter::state::land::{LandingState, LandingType};
use crate::fighter::state::{CollisionContext, FighterState, InterruptContext, air_attack, air_dodge};
use crate::fighter::state::{
CollisionContext, FighterState, InterruptContext, air_attack, air_dodge,
};
use crate::fighter::*;
use crate::input::FighterCommands;
@@ -106,22 +108,17 @@ pub fn update_standard_motion(
airborne_common.is_fast_falling,
);
apply_air_drift(ctx.velocity, ctx.fighter_attributes, ctx.input);
apply_air_motion(
ctx.velocity,
ctx.translation,
ctx.prev_translation,
);
apply_air_motion(ctx.velocity, ctx.translation, ctx.prev_translation);
}
pub fn air_interrupts_common(ctx: &mut InterruptContext, airborne_state_common: &AirborneStateCommon) -> Option<FighterState> {
if ctx.input.has_command(FighterCommands::Jump) {
Some(FighterState::Jump(JumpState {
jump_type: JumpType::DoubleJump,
airborne_state_common: AirborneStateCommon::default(),
}))
} else {
air_dodge::check_input(ctx).or_else(|| air_attack::check_interrupt(ctx, airborne_state_common))
}
pub fn air_interrupts_common(
ctx: &mut InterruptContext,
airborne_state_common: &AirborneStateCommon,
) -> Option<FighterState> {
jump::check_input_double_jump(ctx).or_else(|| {
air_dodge::check_input(ctx)
.or_else(|| air_attack::check_interrupt(ctx, airborne_state_common))
})
}
pub fn collision_interrupt(