diff --git a/src/game/setup.rs b/src/game/setup.rs index 71b339c..7c5d9b6 100644 --- a/src/game/setup.rs +++ b/src/game/setup.rs @@ -50,6 +50,7 @@ pub fn setup_player( ) { let circle = Circle::new(radius.0); commands.spawn(( + Name::new("Player"), Player, Collider::from(circle), Mesh2d(meshes.add(circle)), @@ -65,9 +66,10 @@ pub fn setup_balls( region: Res, ) { 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)); commands.spawn(( + Name::new(format!("Ball[{i}]")), Ball, Collider::from(circle), Mesh2d(meshes.add(circle)), @@ -104,6 +106,7 @@ pub fn setup_walls( ); commands.spawn(( + Name::new(format!("Wall[{i}]")), Wall, Collider::rectangle(length, thickness), Mesh2d(meshes.add(Rectangle::new(length, thickness))),