Refactor loading
This commit is contained in:
+4
-2
@@ -100,7 +100,6 @@ pub fn postprocess_input(
|
||||
game_settings: Res<GameSettings>,
|
||||
) {
|
||||
for (mut input, player) in query {
|
||||
|
||||
for command in FighterCommands::iter() {
|
||||
input.reduce_command_lifetime(command);
|
||||
}
|
||||
@@ -128,7 +127,10 @@ pub fn postprocess_input(
|
||||
}
|
||||
|
||||
if !input.prev_frame.jump && input.current_frame.jump {
|
||||
input.set_lifetime(FighterCommands::Jump, game_settings.input_common.input_buffer_size);
|
||||
input.set_lifetime(
|
||||
FighterCommands::Jump,
|
||||
game_settings.input_common.input_buffer_size,
|
||||
);
|
||||
}
|
||||
|
||||
if x_abs >= axis_threshold && input.frames_in_smash_move_deadzone <= frame_threshold {
|
||||
|
||||
+1
-1
@@ -9,5 +9,5 @@ use crate::{input::InputActionState, math::vec::FGVec2};
|
||||
pub struct FighterInputFrame {
|
||||
pub movement: FGVec2,
|
||||
pub directional_attack: FGVec2,
|
||||
pub jump: bool
|
||||
pub jump: bool,
|
||||
}
|
||||
|
||||
@@ -44,9 +44,7 @@ pub fn preprocess_keyboard_input(
|
||||
InputMapAction::MovementYDir(sign) => {
|
||||
input_frame.movement.y += (sign) * action_strength
|
||||
}
|
||||
InputMapAction::Jump => {
|
||||
input_frame.jump = action_strength != FGi32::ZERO
|
||||
},
|
||||
InputMapAction::Jump => input_frame.jump = action_strength != FGi32::ZERO,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user