diff --git a/examples/games/contributors.rs b/examples/games/contributors.rs index aba9d7970b..7cc038e06a 100644 --- a/examples/games/contributors.rs +++ b/examples/games/contributors.rs @@ -15,7 +15,7 @@ fn main() { .add_system(move_system) .add_system(collision_system) .add_system(select_system) - .insert_resource(SelectionState::default()) + .init_resource::() .run(); } @@ -23,7 +23,7 @@ fn main() { type Contributors = HashSet; struct ContributorSelection { - order: Vec<(String, Entity)>, + order: Vec, idx: usize, } @@ -46,6 +46,7 @@ struct ContributorDisplay; #[derive(Component)] struct Contributor { + name: String, hue: f32, } @@ -85,23 +86,23 @@ fn setup_contributor_selection(mut commands: Commands, asset_server: Res, mut query: Query<(&mut Velocity, &mut Transform), With>, ) { - let mut rnd = rand::thread_rng(); + let mut rng = rand::thread_rng(); let window = windows.primary(); @@ -277,7 +275,7 @@ fn collision_system( if bottom < ground { transform.translation.y = ground + SPRITE_SIZE / 2.0; // apply an impulse upwards - velocity.translation.y = rnd.gen_range(700.0..1000.0); + velocity.translation.y = rng.gen_range(700.0..1000.0); } if top > ceiling { transform.translation.y = ceiling - SPRITE_SIZE / 2.0;