Add names to entities
This commit is contained in:
parent
2df3f0262b
commit
bef0b66ee1
1 changed files with 4 additions and 1 deletions
|
@ -50,6 +50,7 @@ pub fn setup_player(
|
||||||
) {
|
) {
|
||||||
let circle = Circle::new(radius.0);
|
let circle = Circle::new(radius.0);
|
||||||
commands.spawn((
|
commands.spawn((
|
||||||
|
Name::new("Player"),
|
||||||
Player,
|
Player,
|
||||||
Collider::from(circle),
|
Collider::from(circle),
|
||||||
Mesh2d(meshes.add(circle)),
|
Mesh2d(meshes.add(circle)),
|
||||||
|
@ -65,9 +66,10 @@ pub fn setup_balls(
|
||||||
region: Res<PlayableArea>,
|
region: Res<PlayableArea>,
|
||||||
) {
|
) {
|
||||||
let mut random = thread_rng();
|
let mut random = thread_rng();
|
||||||
for _ in 0..BALL_COUNT {
|
for i in 0..BALL_COUNT {
|
||||||
let circle = Circle::new(random.random_range(BALL_SIZES));
|
let circle = Circle::new(random.random_range(BALL_SIZES));
|
||||||
commands.spawn((
|
commands.spawn((
|
||||||
|
Name::new(format!("Ball[{i}]")),
|
||||||
Ball,
|
Ball,
|
||||||
Collider::from(circle),
|
Collider::from(circle),
|
||||||
Mesh2d(meshes.add(circle)),
|
Mesh2d(meshes.add(circle)),
|
||||||
|
@ -104,6 +106,7 @@ pub fn setup_walls(
|
||||||
);
|
);
|
||||||
|
|
||||||
commands.spawn((
|
commands.spawn((
|
||||||
|
Name::new(format!("Wall[{i}]")),
|
||||||
Wall,
|
Wall,
|
||||||
Collider::rectangle(length, thickness),
|
Collider::rectangle(length, thickness),
|
||||||
Mesh2d(meshes.add(Rectangle::new(length, thickness))),
|
Mesh2d(meshes.add(Rectangle::new(length, thickness))),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue