Integrate basic attack script debug.

This commit is contained in:
2026-08-30 14:45:26 +02:00
parent af0e567332
commit 1d5a07324d
19 changed files with 353 additions and 43 deletions
+11
View File
@@ -20,6 +20,7 @@ pub enum FighterCommands {
SmashMoveRight,
Jump,
Shield,
Attack,
}
/// Frames of life remaining for each buffered command. Indexed by
@@ -30,6 +31,7 @@ pub struct FighterCommandLifetimes {
smash_move_right: u8,
jump: u8,
shield: u8,
attack: u8,
}
impl Index<FighterCommands> for FighterCommandLifetimes {
@@ -41,6 +43,7 @@ impl Index<FighterCommands> for FighterCommandLifetimes {
FighterCommands::SmashMoveRight => &self.smash_move_right,
FighterCommands::Jump => &self.jump,
FighterCommands::Shield => &self.shield,
FighterCommands::Attack => &self.attack,
}
}
}
@@ -52,6 +55,7 @@ impl IndexMut<FighterCommands> for FighterCommandLifetimes {
FighterCommands::SmashMoveRight => &mut self.smash_move_right,
FighterCommands::Jump => &mut self.jump,
FighterCommands::Shield => &mut self.shield,
FighterCommands::Attack => &mut self.attack,
}
}
}
@@ -148,6 +152,13 @@ pub fn postprocess_input(
);
}
if !input.prev_frame.attack && input.current_frame.attack {
input.set_lifetime(
FighterCommands::Attack,
game_settings.input_common.input_buffer_size,
);
}
if x_abs >= axis_threshold && input.frames_in_smash_move_deadzone <= frame_threshold {
input.clear_command(FighterCommands::SmashMoveLeft);
input.clear_command(FighterCommands::SmashMoveRight);