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:
+7
-1
@@ -22,6 +22,7 @@ pub enum FighterCommands {
|
||||
SmashMoveDown,
|
||||
SmashMoveLeft,
|
||||
SmashMoveRight,
|
||||
TapJump,
|
||||
}
|
||||
|
||||
pub(crate) fn second_binding_pressed(
|
||||
@@ -32,7 +33,7 @@ pub(crate) fn second_binding_pressed(
|
||||
}
|
||||
|
||||
impl FighterCommands {
|
||||
pub const COUNT: usize = 8;
|
||||
pub const COUNT: usize = 9;
|
||||
|
||||
pub const fn index(self) -> usize {
|
||||
match self {
|
||||
@@ -44,6 +45,7 @@ impl FighterCommands {
|
||||
Self::SmashMoveDown => 5,
|
||||
Self::SmashMoveLeft => 6,
|
||||
Self::SmashMoveRight => 7,
|
||||
Self::TapJump => 8,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -514,6 +516,10 @@ pub fn postprocess_input(
|
||||
y_flick_detected = !x_flick_detected;
|
||||
}
|
||||
|
||||
if y_flick_detected && input.current_frame.movement.y > 0.0 {
|
||||
input.set_lifetime(FighterCommands::TapJump, tap);
|
||||
}
|
||||
|
||||
if attack_pressed {
|
||||
let attack_type = if y_flick_detected {
|
||||
if input.current_frame.movement.y > 0.0 {
|
||||
|
||||
Reference in New Issue
Block a user