Re-order use statements, prefer crate mods first

This commit is contained in:
2025-08-09 14:49:10 -05:00
parent 61c57783f1
commit 73b97ad15c
4 changed files with 16 additions and 12 deletions

View File

@@ -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;

View File

@@ -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);

View File

@@ -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)

View File

@@ -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;