diff --git a/src/lib.rs b/src/lib.rs index 584af16..f968fbc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,21 +6,22 @@ mod preparation_widget; mod ship; mod title_screen; -use crate::config::{BACKGROUND_COLOR, PLAYER_SHIP_COLOR, SHIP_ROTATION, SHIP_THRUST, WINDOW_SIZE}; +use crate::asteroids::{Asteroid, AsteroidSpawner}; +use crate::config::{ + ASTEROID_SMALL_COLOR, BACKGROUND_COLOR, PLAYER_SHIP_COLOR, SHIP_ROTATION, SHIP_THRUST, + SHIP_THRUSTER_COLOR_ACTIVE, SHIP_THRUSTER_COLOR_INACTIVE, WINDOW_SIZE, +}; +use crate::physics::Rotation; +use crate::ship::Ship; -use asteroids::{Asteroid, AsteroidSpawner}; use bevy::prelude::*; use bevy_inspector_egui::InspectorOptions; use bevy_inspector_egui::prelude::ReflectInspectorOptions; - use bevy_rapier2d::{ plugin::{NoUserData, RapierPhysicsPlugin}, prelude::*, render::RapierDebugRenderPlugin, }; -use config::{ASTEROID_SMALL_COLOR, SHIP_THRUSTER_COLOR_ACTIVE, SHIP_THRUSTER_COLOR_INACTIVE}; -use physics::Rotation; -use ship::Ship; pub struct AsteroidPlugin; diff --git a/src/physics.rs b/src/physics.rs index 349ce42..7d2021e 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -1,10 +1,10 @@ //! Custom physics items //! TODO: Refactor in terms of Rapier2D, *or* implement colliders and remove it. -use bevy::prelude::*; - use crate::WorldSize; +use bevy::prelude::*; + #[derive(Component)] pub(crate) struct Position(pub(crate) bevy::math::Vec2); diff --git a/src/preparation_widget.rs b/src/preparation_widget.rs index 53767ed..d1e6e24 100644 --- a/src/preparation_widget.rs +++ b/src/preparation_widget.rs @@ -1,10 +1,10 @@ +use crate::GameState; + use bevy::{ color::palettes::css::{BLACK, GREEN, LIGHT_BLUE, RED}, prelude::*, }; -use crate::GameState; - pub fn preparation_widget_plugin(app: &mut App) { app.add_systems(OnEnter(GameState::GetReady), spawn_get_ready) .add_systems(OnExit(GameState::GetReady), despawn_get_ready) diff --git a/src/ship.rs b/src/ship.rs index ed813b2..da6b297 100644 --- a/src/ship.rs +++ b/src/ship.rs @@ -1,8 +1,11 @@ +use crate::{ + GameAssets, Rotation, + physics::{Position, Velocity, Wrapping}, +}; + use bevy::prelude::*; use bevy_rapier2d::prelude::*; -use crate::{GameAssets, Rotation, physics::Position, physics::Velocity, physics::Wrapping}; - #[derive(Component)] pub struct Ship;