Start game from the lobby by the admin #86

Merged
raphael merged 8 commits from start-game into main 2024-03-31 13:47:28 +00:00
Showing only changes of commit 4e5f7155ab - Show all commits

View file

@ -69,15 +69,17 @@ fn lobby_ui(
return;
}
ui.add(egui::Slider::new(&mut (*map_size), 0..=5).text("map size"));
ui.add(egui::Slider::new(&mut (*map_size), 1..=5).text("map size"));
if !ui.button("Run the game").clicked() {
return;
}
let seed = rand::thread_rng().gen::<u32>();
let radius =
get_map_sizes(all_players_query.iter().count() as u32)[*map_size as usize] as u16;
let index = *map_size as usize;
let nomber_of_players = all_players_query.iter().count() as u32;
let radius = get_map_sizes(nomber_of_players)[index] as u16 * 2;
// Start the game.
for player in all_players_query.iter() {