Delete unused entity spawn, add player color const
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
|
|
||||||
use bevy::{math::VectorSpace, prelude::*, sprite::MaterialMesh2dBundle};
|
use bevy::{prelude::*, sprite::MaterialMesh2dBundle};
|
||||||
|
|
||||||
const BACKGROUND_COLOR: Color = Color::srgb(0.4, 0.4, 0.4);
|
const BACKGROUND_COLOR: Color = Color::srgb(0.4, 0.4, 0.4);
|
||||||
|
const PLAYERBOID_COLOR: Color = Color::srgb(1.0, 0.0, 0.0);
|
||||||
|
|
||||||
pub struct BoidsPlugin;
|
pub struct BoidsPlugin;
|
||||||
|
|
||||||
@@ -70,28 +71,12 @@ fn spawn_boids(
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
commands.spawn((
|
|
||||||
SpriteBundle {
|
|
||||||
transform: Transform {
|
|
||||||
translation: Vec3::new(0.0, 10.0, 0.0),
|
|
||||||
scale: Vec3::new(1.0, 1.0, 1.0),
|
|
||||||
..default()
|
|
||||||
},
|
|
||||||
sprite: Sprite {
|
|
||||||
color: Color::srgb(1.0, 0.0, 0.0),
|
|
||||||
..default()
|
|
||||||
},
|
|
||||||
..default()
|
|
||||||
},
|
|
||||||
Boid
|
|
||||||
));
|
|
||||||
|
|
||||||
commands.spawn((
|
commands.spawn((
|
||||||
BoidBundle::new(Vec3::new(0.0, 0.0, 0.0)),
|
BoidBundle::new(Vec3::new(0.0, 0.0, 0.0)),
|
||||||
PlayerBoid,
|
PlayerBoid,
|
||||||
MaterialMesh2dBundle {
|
MaterialMesh2dBundle {
|
||||||
mesh: meshes.add(Triangle2d::default()).into(),
|
mesh: meshes.add(Triangle2d::default()).into(),
|
||||||
material: materials.add(Color::srgb(1.0, 0.0, 0.0)),
|
material: materials.add(PLAYERBOID_COLOR),
|
||||||
..default()
|
..default()
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|||||||
Reference in New Issue
Block a user