Implement tap jump and clean some fluff (#83)
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:
+13
-16
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user