Re-order use statements, prefer crate mods first
This commit is contained in:
13
src/lib.rs
13
src/lib.rs
@@ -6,21 +6,22 @@ mod preparation_widget;
|
|||||||
mod ship;
|
mod ship;
|
||||||
mod title_screen;
|
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::prelude::*;
|
||||||
use bevy_inspector_egui::InspectorOptions;
|
use bevy_inspector_egui::InspectorOptions;
|
||||||
use bevy_inspector_egui::prelude::ReflectInspectorOptions;
|
use bevy_inspector_egui::prelude::ReflectInspectorOptions;
|
||||||
|
|
||||||
use bevy_rapier2d::{
|
use bevy_rapier2d::{
|
||||||
plugin::{NoUserData, RapierPhysicsPlugin},
|
plugin::{NoUserData, RapierPhysicsPlugin},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
render::RapierDebugRenderPlugin,
|
render::RapierDebugRenderPlugin,
|
||||||
};
|
};
|
||||||
use config::{ASTEROID_SMALL_COLOR, SHIP_THRUSTER_COLOR_ACTIVE, SHIP_THRUSTER_COLOR_INACTIVE};
|
|
||||||
use physics::Rotation;
|
|
||||||
use ship::Ship;
|
|
||||||
|
|
||||||
pub struct AsteroidPlugin;
|
pub struct AsteroidPlugin;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
//! Custom physics items
|
//! Custom physics items
|
||||||
//! TODO: Refactor in terms of Rapier2D, *or* implement colliders and remove it.
|
//! TODO: Refactor in terms of Rapier2D, *or* implement colliders and remove it.
|
||||||
|
|
||||||
use bevy::prelude::*;
|
|
||||||
|
|
||||||
use crate::WorldSize;
|
use crate::WorldSize;
|
||||||
|
|
||||||
|
use bevy::prelude::*;
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
pub(crate) struct Position(pub(crate) bevy::math::Vec2);
|
pub(crate) struct Position(pub(crate) bevy::math::Vec2);
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
|
use crate::GameState;
|
||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
color::palettes::css::{BLACK, GREEN, LIGHT_BLUE, RED},
|
color::palettes::css::{BLACK, GREEN, LIGHT_BLUE, RED},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::GameState;
|
|
||||||
|
|
||||||
pub fn preparation_widget_plugin(app: &mut App) {
|
pub fn preparation_widget_plugin(app: &mut App) {
|
||||||
app.add_systems(OnEnter(GameState::GetReady), spawn_get_ready)
|
app.add_systems(OnEnter(GameState::GetReady), spawn_get_ready)
|
||||||
.add_systems(OnExit(GameState::GetReady), despawn_get_ready)
|
.add_systems(OnExit(GameState::GetReady), despawn_get_ready)
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
|
use crate::{
|
||||||
|
GameAssets, Rotation,
|
||||||
|
physics::{Position, Velocity, Wrapping},
|
||||||
|
};
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy_rapier2d::prelude::*;
|
use bevy_rapier2d::prelude::*;
|
||||||
|
|
||||||
use crate::{GameAssets, Rotation, physics::Position, physics::Velocity, physics::Wrapping};
|
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
pub struct Ship;
|
pub struct Ship;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user