Fix formatting and shit
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use bevy::{mesh::skinning::SkinnedMesh, prelude::*};
|
||||
use bevy::prelude::*;
|
||||
|
||||
use crate::{
|
||||
fighter::{FighterECB, FighterFacingDirection, FighterTranslation, FighterVisual, visual::FighterAnimations}, player::Player,
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
//! 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::{FighterECB, FighterPreviousTranslation, FighterTranslation, FighterVelocity};
|
||||
use crate::math::segment::FGSegment2d;
|
||||
use crate::math::vec::FGVec2;
|
||||
use crate::stage::StagePoly;
|
||||
use crate::stage::line::{StageCollision, StageLineID};
|
||||
use crate::stage::line::StageLineID;
|
||||
/*
|
||||
pub fn collide_fighter_with_scene(
|
||||
fighters: Query<(&FighterECB, &mut FighterVelocity, &mut FighterTranslation)>,
|
||||
|
||||
@@ -49,8 +49,8 @@ pub fn fighter_debug(
|
||||
pub fn update_config(
|
||||
mut config_store: ResMut<GizmoConfigStore>,
|
||||
keyboard: Res<ButtonInput<KeyCode>>,
|
||||
real_time: Res<Time<Real>>,
|
||||
mut virtual_time: ResMut<Time<Virtual>>,
|
||||
_real_time: Res<Time<Real>>,
|
||||
_virtual_time: ResMut<Time<Virtual>>,
|
||||
) {
|
||||
if keyboard.just_pressed(KeyCode::KeyT) {
|
||||
for (_, config, _) in config_store.iter_mut() {
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
//! Everything fighter-shaped: the components that describe a fighter, the
|
||||
//! 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_ggrs::prelude::*;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
use bevy::prelude::*;
|
||||
|
||||
use crate::{fighter::FighterAttributes, math::vec::FGVec2};
|
||||
use crate::math::vec::FGVec2;
|
||||
|
||||
#[derive(Component, Clone, Copy)]
|
||||
pub struct Grounded;
|
||||
@@ -27,7 +27,7 @@ pub fn apply_air_motion(
|
||||
)>,
|
||||
_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;
|
||||
translation.0 += velocity.0;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
use bevy::prelude::*;
|
||||
use fixed::traits::Fixed;
|
||||
|
||||
use crate::fighter::*;
|
||||
|
||||
@@ -8,14 +8,8 @@ use crate::fighter::animation::AnimKind;
|
||||
use crate::fighter::state::FighterState;
|
||||
use crate::fighter::state::fall::FallState;
|
||||
use crate::fighter::state::ground::{GroundedMotionResult, GroundedStateCommon};
|
||||
use crate::fighter::state::wait::WaitState;
|
||||
use crate::fighter::{FighterAttributes, FighterFacingDirection, FighterVelocity, collision};
|
||||
use crate::game_settings::GameSettings;
|
||||
use crate::input::{
|
||||
FighterCommands::{SmashMoveLeft, SmashMoveRight},
|
||||
FighterInput,
|
||||
};
|
||||
use crate::math::int::FGi32;
|
||||
use crate::fighter::FighterFacingDirection;
|
||||
use crate::input::FighterCommands::{SmashMoveLeft, SmashMoveRight};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct DashState {
|
||||
|
||||
@@ -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::land::LandingState;
|
||||
use crate::fighter::state::wait::WaitState;
|
||||
use crate::fighter::state::{FighterState, air};
|
||||
use crate::fighter::{FighterAttributes, FighterVelocity, collision, motion};
|
||||
use crate::game_settings::GameSettings;
|
||||
use crate::stage::line::StageCollision;
|
||||
use crate::fighter::collision;
|
||||
|
||||
#[derive(Debug, Clone, Copy, Hash)]
|
||||
pub struct FallState;
|
||||
|
||||
impl FighterStateImpl for FallState {
|
||||
const NAME: &'static str = "Fall";
|
||||
fn check_interrupt(&self, state_context: &FighterStateContext) -> Option<FighterState> {
|
||||
fn check_interrupt(&self, _state_context: &FighterStateContext) -> Option<FighterState> {
|
||||
None
|
||||
}
|
||||
|
||||
|
||||
@@ -4,14 +4,13 @@
|
||||
|
||||
use crate::fighter::state::{FighterState, FighterStateContext};
|
||||
use crate::fighter::{
|
||||
FighterAttributes, FighterECB, FighterPreviousTranslation, FighterTranslation, FighterVelocity,
|
||||
FighterAttributes, FighterPreviousTranslation, FighterTranslation, FighterVelocity,
|
||||
};
|
||||
use crate::game_settings::GameSettings;
|
||||
use crate::math::int::FGi32;
|
||||
use crate::math::vec::FGVec2;
|
||||
use crate::stage::StagePoly;
|
||||
use crate::stage::line::{
|
||||
StageCollision, StageLineID, StagePolyLineSegment, StagePolyLineSegmentType,
|
||||
StageLineID, StagePolyLineSegmentType,
|
||||
};
|
||||
|
||||
use bevy::prelude::*;
|
||||
@@ -89,7 +88,7 @@ pub fn apply_grounded_motion(
|
||||
pub fn collide_with_stage_grounded(
|
||||
state_context: &mut FighterStateContext,
|
||||
ground_common: &mut GroundedStateCommon,
|
||||
can_walk_off: bool,
|
||||
_can_walk_off: bool,
|
||||
) -> GroundedMotionResult {
|
||||
let translation = &mut state_context.translation;
|
||||
let ecb = &state_context.ecb;
|
||||
|
||||
@@ -5,7 +5,7 @@ use bevy::prelude::*;
|
||||
use crate::{
|
||||
fighter::{
|
||||
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,
|
||||
};
|
||||
@@ -98,7 +98,7 @@ impl FighterStateImpl for JumpSquatState {
|
||||
|
||||
impl FighterStateImpl for JumpState {
|
||||
const NAME: &'static str = "Jump";
|
||||
fn check_interrupt(&self, state_context: &FighterStateContext) -> Option<FighterState> {
|
||||
fn check_interrupt(&self, _state_context: &FighterStateContext) -> Option<FighterState> {
|
||||
None
|
||||
}
|
||||
|
||||
|
||||
@@ -2,20 +2,16 @@ use std::time::Duration;
|
||||
|
||||
use bevy::prelude::*;
|
||||
|
||||
use crate::{
|
||||
fighter::{
|
||||
use crate::fighter::{
|
||||
animation::AnimKind,
|
||||
collision,
|
||||
state::{
|
||||
FighterState, FighterStateContext, FighterStateImpl, air, dash,
|
||||
FighterState, FighterStateContext, FighterStateImpl, dash,
|
||||
fall::FallState,
|
||||
ground::{self, GroundedMotionResult, GroundedStateCommon},
|
||||
wait::WaitState,
|
||||
walk,
|
||||
},
|
||||
},
|
||||
input::FighterCommands,
|
||||
};
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone, Hash)]
|
||||
pub struct LandingState {
|
||||
|
||||
@@ -7,9 +7,6 @@ use crate::fighter::animation::AnimKind;
|
||||
use crate::fighter::state::FighterState;
|
||||
use crate::fighter::state::fall::FallState;
|
||||
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;
|
||||
|
||||
#[derive(Component, Debug, Clone, Hash)]
|
||||
|
||||
@@ -9,9 +9,6 @@ use crate::fighter::state::ground::{
|
||||
GroundedMotionResult, GroundedStateCommon, grounded_movement_common_interrupts,
|
||||
};
|
||||
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)]
|
||||
pub struct WaitState {
|
||||
|
||||
@@ -6,10 +6,7 @@ use super::{FighterStateContext, FighterStateImpl, dash, ground, wait};
|
||||
use crate::fighter::animation::AnimKind;
|
||||
use crate::fighter::state::fall::FallState;
|
||||
use crate::fighter::state::ground::{GroundedMotionResult, GroundedStateCommon};
|
||||
use crate::fighter::state::{self, FighterState};
|
||||
use crate::fighter::{FighterAttributes, FighterVelocity};
|
||||
use crate::game_settings::GameSettings;
|
||||
use crate::input::FighterInput;
|
||||
use crate::fighter::state::FighterState;
|
||||
|
||||
#[derive(Debug, Clone, Hash)]
|
||||
pub struct WalkState {
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
use bevy::prelude::*;
|
||||
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
|
||||
/// sends over the wire, so keep it small and keep it `PartialEq`.
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
use bevy::math::{Vec2, primitives::Segment2d};
|
||||
|
||||
use fixed::prelude::*;
|
||||
|
||||
pub type FGi32 = fixed::FixedI32<fixed::types::extra::U16>;
|
||||
pub type FGWide = fixed::FixedI128<fixed::types::extra::U32>;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
use bevy::math::{Vec2, primitives::Segment2d};
|
||||
|
||||
use bevy::prelude::*;
|
||||
use fixed::prelude::*;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
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>) {
|
||||
for poly in stage_collision.stage_polys.iter() {
|
||||
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
//! Stage collision geometry.
|
||||
|
||||
use std::default;
|
||||
|
||||
use bevy::{math::InvalidDirectionError, prelude::*};
|
||||
use bevy::prelude::*;
|
||||
|
||||
use crate::math::{segment::FGSegment2d, vec::FGVec2};
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
use std::f32::consts::PI;
|
||||
|
||||
use bevy::{camera_controller::free_camera::FreeCamera, prelude::*};
|
||||
use bevy::prelude::*;
|
||||
|
||||
use crate::{
|
||||
math::vec::FGVec2,
|
||||
|
||||
Reference in New Issue
Block a user