Make dashback configurable, fix movement bugs, add double jump forward and back.
This commit is contained in:
+11
-13
@@ -2,18 +2,10 @@ use bevy::prelude::*;
|
||||
|
||||
use crate::{
|
||||
fighter::{
|
||||
animation::AnimKind,
|
||||
collision,
|
||||
state::{
|
||||
FighterState, FighterStateContext, FighterStateImpl, air,
|
||||
air_dodge::{self, AirDodgeState},
|
||||
fall::FallState,
|
||||
ground::{self, GroundedMotionResult, GroundedStateCommon},
|
||||
land::LandingState,
|
||||
animation::AnimKind, collision, state::{
|
||||
FighterState, FighterStateContext, FighterStateImpl, air, air_dodge::{self, AirDodgeState}, fall::FallState, ground::{self, GroundedMotionResult, GroundedStateCommon}, land::{LandingState, LandingType},
|
||||
},
|
||||
},
|
||||
input::FighterCommands,
|
||||
math::{int::FGi32, vec::FGVec2},
|
||||
}, input::FighterCommands, math::{int::FGi32, vec::FGVec2},
|
||||
};
|
||||
#[derive(Debug, Hash, Clone, Copy)]
|
||||
pub enum JumpType {
|
||||
@@ -174,7 +166,13 @@ impl FighterStateImpl for JumpState {
|
||||
}
|
||||
}
|
||||
JumpType::DoubleJump => {
|
||||
state_context.play_animation(AnimKind::DoubleJump, false);
|
||||
if movement_stick_x.is_zero()
|
||||
|| movement_stick_x.signum() == state_context.facing_direction.to_sign()
|
||||
{
|
||||
state_context.play_animation(AnimKind::DoubleJumpForward, false);
|
||||
} else {
|
||||
state_context.play_animation(AnimKind::DoubleJumpBack, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,7 +231,7 @@ impl FighterStateImpl for JumpState {
|
||||
let grounded_common = GroundedStateCommon {
|
||||
current_line_id: res.line_id,
|
||||
};
|
||||
Some(FighterState::Land(LandingState { grounded_common }))
|
||||
Some(FighterState::Land(LandingState::create(grounded_common, LandingType::Normal)))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user