Fix formatting and shit

This commit is contained in:
2026-08-26 21:35:43 +02:00
parent a857a3c814
commit d9222409ce
20 changed files with 26 additions and 59 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
use std::time::Duration; use std::time::Duration;
use bevy::{mesh::skinning::SkinnedMesh, prelude::*}; use bevy::prelude::*;
use crate::{ use crate::{
fighter::{FighterECB, FighterFacingDirection, FighterTranslation, FighterVisual, visual::FighterAnimations}, player::Player, fighter::{FighterECB, FighterFacingDirection, FighterTranslation, FighterVisual, visual::FighterAnimations}, player::Player,
+2 -5
View File
@@ -1,14 +1,11 @@
//! Resolving an integrated fighter position against the stage. //! Resolving an integrated fighter position against the stage.
use bevy::{color::palettes::css::HOT_PINK, prelude::*}; use bevy::prelude::*;
use crate::fighter::ecb::FighterPreviousECB;
use crate::fighter::state::FighterStateContext; use crate::fighter::state::FighterStateContext;
use crate::fighter::{FighterECB, FighterPreviousTranslation, FighterTranslation, FighterVelocity};
use crate::math::segment::FGSegment2d; use crate::math::segment::FGSegment2d;
use crate::math::vec::FGVec2; use crate::math::vec::FGVec2;
use crate::stage::StagePoly; use crate::stage::line::StageLineID;
use crate::stage::line::{StageCollision, StageLineID};
/* /*
pub fn collide_fighter_with_scene( pub fn collide_fighter_with_scene(
fighters: Query<(&FighterECB, &mut FighterVelocity, &mut FighterTranslation)>, fighters: Query<(&FighterECB, &mut FighterVelocity, &mut FighterTranslation)>,
+2 -2
View File
@@ -49,8 +49,8 @@ pub fn fighter_debug(
pub fn update_config( pub fn update_config(
mut config_store: ResMut<GizmoConfigStore>, mut config_store: ResMut<GizmoConfigStore>,
keyboard: Res<ButtonInput<KeyCode>>, keyboard: Res<ButtonInput<KeyCode>>,
real_time: Res<Time<Real>>, _real_time: Res<Time<Real>>,
mut virtual_time: ResMut<Time<Virtual>>, _virtual_time: ResMut<Time<Virtual>>,
) { ) {
if keyboard.just_pressed(KeyCode::KeyT) { if keyboard.just_pressed(KeyCode::KeyT) {
for (_, config, _) in config_store.iter_mut() { for (_, config, _) in config_store.iter_mut() {
+1 -1
View File
@@ -1,7 +1,7 @@
//! Everything fighter-shaped: the components that describe a fighter, the //! Everything fighter-shaped: the components that describe a fighter, the
//! state machine that drives it, and the plugin that schedules it all. //! state machine that drives it, and the plugin that schedules it all.
use bevy::{ecs::name::HashedStr, prelude::*}; use bevy::prelude::*;
use bevy_egui::EguiPrimaryContextPass; use bevy_egui::EguiPrimaryContextPass;
use bevy_ggrs::prelude::*; use bevy_ggrs::prelude::*;
+2 -2
View File
@@ -3,7 +3,7 @@
use bevy::prelude::*; use bevy::prelude::*;
use crate::{fighter::FighterAttributes, math::vec::FGVec2}; use crate::math::vec::FGVec2;
#[derive(Component, Clone, Copy)] #[derive(Component, Clone, Copy)]
pub struct Grounded; pub struct Grounded;
@@ -27,7 +27,7 @@ pub fn apply_air_motion(
)>, )>,
_time: Res<Time<Fixed>>, _time: Res<Time<Fixed>>,
) { ) {
for (velocity, mut translation, mut prev_translation, mut transform) in fighters { for (velocity, mut translation, mut prev_translation, _transform) in fighters {
prev_translation.0 = translation.0; prev_translation.0 = translation.0;
translation.0 += velocity.0; translation.0 += velocity.0;
} }
-1
View File
@@ -1,4 +1,3 @@
use bevy::prelude::*;
use fixed::traits::Fixed; use fixed::traits::Fixed;
use crate::fighter::*; use crate::fighter::*;
+2 -8
View File
@@ -8,14 +8,8 @@ use crate::fighter::animation::AnimKind;
use crate::fighter::state::FighterState; use crate::fighter::state::FighterState;
use crate::fighter::state::fall::FallState; use crate::fighter::state::fall::FallState;
use crate::fighter::state::ground::{GroundedMotionResult, GroundedStateCommon}; use crate::fighter::state::ground::{GroundedMotionResult, GroundedStateCommon};
use crate::fighter::state::wait::WaitState; use crate::fighter::FighterFacingDirection;
use crate::fighter::{FighterAttributes, FighterFacingDirection, FighterVelocity, collision}; use crate::input::FighterCommands::{SmashMoveLeft, SmashMoveRight};
use crate::game_settings::GameSettings;
use crate::input::{
FighterCommands::{SmashMoveLeft, SmashMoveRight},
FighterInput,
};
use crate::math::int::FGi32;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct DashState { pub struct DashState {
+3 -7
View File
@@ -1,20 +1,16 @@
use bevy::prelude::*;
use super::{FighterStateContext, FighterStateImpl, ground, walk}; use super::{FighterStateContext, FighterStateImpl};
use crate::fighter::state::ground::GroundedStateCommon; use crate::fighter::state::ground::GroundedStateCommon;
use crate::fighter::state::land::LandingState; use crate::fighter::state::land::LandingState;
use crate::fighter::state::wait::WaitState;
use crate::fighter::state::{FighterState, air}; use crate::fighter::state::{FighterState, air};
use crate::fighter::{FighterAttributes, FighterVelocity, collision, motion}; use crate::fighter::collision;
use crate::game_settings::GameSettings;
use crate::stage::line::StageCollision;
#[derive(Debug, Clone, Copy, Hash)] #[derive(Debug, Clone, Copy, Hash)]
pub struct FallState; pub struct FallState;
impl FighterStateImpl for FallState { impl FighterStateImpl for FallState {
const NAME: &'static str = "Fall"; const NAME: &'static str = "Fall";
fn check_interrupt(&self, state_context: &FighterStateContext) -> Option<FighterState> { fn check_interrupt(&self, _state_context: &FighterStateContext) -> Option<FighterState> {
None None
} }
+3 -4
View File
@@ -4,14 +4,13 @@
use crate::fighter::state::{FighterState, FighterStateContext}; use crate::fighter::state::{FighterState, FighterStateContext};
use crate::fighter::{ use crate::fighter::{
FighterAttributes, FighterECB, FighterPreviousTranslation, FighterTranslation, FighterVelocity, FighterAttributes, FighterPreviousTranslation, FighterTranslation, FighterVelocity,
}; };
use crate::game_settings::GameSettings; use crate::game_settings::GameSettings;
use crate::math::int::FGi32; use crate::math::int::FGi32;
use crate::math::vec::FGVec2; use crate::math::vec::FGVec2;
use crate::stage::StagePoly;
use crate::stage::line::{ use crate::stage::line::{
StageCollision, StageLineID, StagePolyLineSegment, StagePolyLineSegmentType, StageLineID, StagePolyLineSegmentType,
}; };
use bevy::prelude::*; use bevy::prelude::*;
@@ -89,7 +88,7 @@ pub fn apply_grounded_motion(
pub fn collide_with_stage_grounded( pub fn collide_with_stage_grounded(
state_context: &mut FighterStateContext, state_context: &mut FighterStateContext,
ground_common: &mut GroundedStateCommon, ground_common: &mut GroundedStateCommon,
can_walk_off: bool, _can_walk_off: bool,
) -> GroundedMotionResult { ) -> GroundedMotionResult {
let translation = &mut state_context.translation; let translation = &mut state_context.translation;
let ecb = &state_context.ecb; let ecb = &state_context.ecb;
+2 -2
View File
@@ -5,7 +5,7 @@ use bevy::prelude::*;
use crate::{ use crate::{
fighter::{ fighter::{
animation::AnimKind, collision, state::{ animation::AnimKind, collision, state::{
FighterState, FighterStateContext, FighterStateImpl, air, fall::FallState, ground::{self, GroundedMotionResult, GroundedStateCommon}, land::LandingState, wait::WaitState, FighterState, FighterStateContext, FighterStateImpl, air, fall::FallState, ground::{self, GroundedMotionResult, GroundedStateCommon}, land::LandingState,
}, },
}, input::FighterCommands, }, input::FighterCommands,
}; };
@@ -98,7 +98,7 @@ impl FighterStateImpl for JumpSquatState {
impl FighterStateImpl for JumpState { impl FighterStateImpl for JumpState {
const NAME: &'static str = "Jump"; const NAME: &'static str = "Jump";
fn check_interrupt(&self, state_context: &FighterStateContext) -> Option<FighterState> { fn check_interrupt(&self, _state_context: &FighterStateContext) -> Option<FighterState> {
None None
} }
+2 -6
View File
@@ -2,19 +2,15 @@ use std::time::Duration;
use bevy::prelude::*; use bevy::prelude::*;
use crate::{ use crate::fighter::{
fighter::{
animation::AnimKind, animation::AnimKind,
collision,
state::{ state::{
FighterState, FighterStateContext, FighterStateImpl, air, dash, FighterState, FighterStateContext, FighterStateImpl, dash,
fall::FallState, fall::FallState,
ground::{self, GroundedMotionResult, GroundedStateCommon}, ground::{self, GroundedMotionResult, GroundedStateCommon},
wait::WaitState, wait::WaitState,
walk, walk,
}, },
},
input::FighterCommands,
}; };
#[derive(Debug, Clone, Hash)] #[derive(Debug, Clone, Hash)]
-3
View File
@@ -7,9 +7,6 @@ use crate::fighter::animation::AnimKind;
use crate::fighter::state::FighterState; use crate::fighter::state::FighterState;
use crate::fighter::state::fall::FallState; use crate::fighter::state::fall::FallState;
use crate::fighter::state::ground::{GroundedMotionResult, GroundedStateCommon}; use crate::fighter::state::ground::{GroundedMotionResult, GroundedStateCommon};
use crate::fighter::{FighterAttributes, FighterVelocity};
use crate::game_settings::GameSettings;
use crate::input::FighterInput;
use crate::math::int::FGi32; use crate::math::int::FGi32;
#[derive(Component, Debug, Clone, Hash)] #[derive(Component, Debug, Clone, Hash)]
-3
View File
@@ -9,9 +9,6 @@ use crate::fighter::state::ground::{
GroundedMotionResult, GroundedStateCommon, grounded_movement_common_interrupts, GroundedMotionResult, GroundedStateCommon, grounded_movement_common_interrupts,
}; };
use crate::fighter::state::{FighterState, dash}; use crate::fighter::state::{FighterState, dash};
use crate::fighter::{FighterAttributes, FighterVelocity};
use crate::game_settings::GameSettings;
use crate::stage::line::StageLineID;
#[derive(Debug, Clone, Hash)] #[derive(Debug, Clone, Hash)]
pub struct WaitState { pub struct WaitState {
+1 -4
View File
@@ -6,10 +6,7 @@ use super::{FighterStateContext, FighterStateImpl, dash, ground, wait};
use crate::fighter::animation::AnimKind; use crate::fighter::animation::AnimKind;
use crate::fighter::state::fall::FallState; use crate::fighter::state::fall::FallState;
use crate::fighter::state::ground::{GroundedMotionResult, GroundedStateCommon}; use crate::fighter::state::ground::{GroundedMotionResult, GroundedStateCommon};
use crate::fighter::state::{self, FighterState}; use crate::fighter::state::FighterState;
use crate::fighter::{FighterAttributes, FighterVelocity};
use crate::game_settings::GameSettings;
use crate::input::FighterInput;
#[derive(Debug, Clone, Hash)] #[derive(Debug, Clone, Hash)]
pub struct WalkState { pub struct WalkState {
+1 -2
View File
@@ -1,7 +1,6 @@
use bevy::prelude::*;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::{input::InputActionState, math::vec::FGVec2}; use crate::math::vec::FGVec2;
/// One frame of a player's raw input. This is the type GGRS serializes and /// One frame of a player's raw input. This is the type GGRS serializes and
/// sends over the wire, so keep it small and keep it `PartialEq`. /// sends over the wire, so keep it small and keep it `PartialEq`.
-2
View File
@@ -1,6 +1,4 @@
use bevy::math::{Vec2, primitives::Segment2d};
use fixed::prelude::*;
pub type FGi32 = fixed::FixedI32<fixed::types::extra::U16>; pub type FGi32 = fixed::FixedI32<fixed::types::extra::U16>;
pub type FGWide = fixed::FixedI128<fixed::types::extra::U32>; pub type FGWide = fixed::FixedI128<fixed::types::extra::U32>;
-1
View File
@@ -1,4 +1,3 @@
use bevy::math::{Vec2, primitives::Segment2d};
use bevy::prelude::*; use bevy::prelude::*;
use fixed::prelude::*; use fixed::prelude::*;
+1 -1
View File
@@ -1,6 +1,6 @@
use bevy::{color::palettes::css::RED, prelude::*}; use bevy::{color::palettes::css::RED, prelude::*};
use crate::stage::{StagePoly, line::StageCollision}; use crate::stage::line::StageCollision;
pub fn debug_draw_scene(mut gizmos: Gizmos, stage_collision: Res<StageCollision>) { pub fn debug_draw_scene(mut gizmos: Gizmos, stage_collision: Res<StageCollision>) {
for poly in stage_collision.stage_polys.iter() { for poly in stage_collision.stage_polys.iter() {
+1 -2
View File
@@ -1,8 +1,7 @@
//! Stage collision geometry. //! Stage collision geometry.
use std::default;
use bevy::{math::InvalidDirectionError, prelude::*}; use bevy::prelude::*;
use crate::math::{segment::FGSegment2d, vec::FGVec2}; use crate::math::{segment::FGSegment2d, vec::FGVec2};
+1 -1
View File
@@ -2,7 +2,7 @@
use std::f32::consts::PI; use std::f32::consts::PI;
use bevy::{camera_controller::free_camera::FreeCamera, prelude::*}; use bevy::prelude::*;
use crate::{ use crate::{
math::vec::FGVec2, math::vec::FGVec2,