Finish removal of Position
The component has been completely removed, and all call sites are fixed to use the Transform directly.
This commit is contained in:
@@ -7,7 +7,7 @@ use std::time::Duration;
|
|||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
|
|
||||||
use crate::{GameAssets, Rotation, WorldSize, physics::Position, physics::Velocity};
|
use crate::{GameAssets, Rotation, WorldSize, physics::Velocity};
|
||||||
|
|
||||||
#[derive(Component, Deref, DerefMut)]
|
#[derive(Component, Deref, DerefMut)]
|
||||||
pub struct Asteroid(AsteroidSize);
|
pub struct Asteroid(AsteroidSize);
|
||||||
@@ -120,7 +120,7 @@ pub fn spawn_asteroid(
|
|||||||
Asteroid(AsteroidSize::Small),
|
Asteroid(AsteroidSize::Small),
|
||||||
Collider::ball(collider_radius),
|
Collider::ball(collider_radius),
|
||||||
Sensor,
|
Sensor,
|
||||||
Position(spawn.pos),
|
Transform::from_translation(spawn.pos.extend(0.0)),
|
||||||
Velocity(spawn.vel),
|
Velocity(spawn.vel),
|
||||||
Rotation(0.0),
|
Rotation(0.0),
|
||||||
Mesh2d(mesh),
|
Mesh2d(mesh),
|
||||||
|
|||||||
@@ -5,9 +5,6 @@ use crate::WorldSize;
|
|||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
|
|
||||||
#[derive(Component)]
|
|
||||||
pub(crate) struct Position(pub(crate) bevy::math::Vec2);
|
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
pub(crate) struct Velocity(pub(crate) bevy::math::Vec2);
|
pub(crate) struct Velocity(pub(crate) bevy::math::Vec2);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
GameAssets, Rotation,
|
GameAssets, Rotation,
|
||||||
physics::{Position, Velocity, Wrapping},
|
physics::{Velocity, Wrapping},
|
||||||
};
|
};
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
@@ -18,7 +18,6 @@ pub fn spawn_player(mut commands: Commands, game_assets: Res<GameAssets>) {
|
|||||||
ActiveCollisionTypes::STATIC_STATIC,
|
ActiveCollisionTypes::STATIC_STATIC,
|
||||||
Ship,
|
Ship,
|
||||||
Wrapping,
|
Wrapping,
|
||||||
Position(Vec2::default()),
|
|
||||||
Velocity(Vec2::ZERO),
|
Velocity(Vec2::ZERO),
|
||||||
Rotation(0.0),
|
Rotation(0.0),
|
||||||
Mesh2d(game_assets.ship().0),
|
Mesh2d(game_assets.ship().0),
|
||||||
|
|||||||
Reference in New Issue
Block a user