Add egui as a UI system

This commit is contained in:
2023-10-17 13:53:11 -05:00
parent ad2a304455
commit c5a6fc769d
5 changed files with 333 additions and 9 deletions

View File

@@ -4,12 +4,14 @@ use bevy::prelude::*;
use crate::components::*;
use crate::util::roll;
pub fn initiate_battle(query: Query<Entity, With<PlayerCharacter>>, mut commands: Commands) {
pub fn initiate_battle(
query: Query<Entity, With<PlayerCharacter>>,
mut commands: Commands
) {
let order: HashMap<u32, Entity> = query.iter().map(|ent| {
let (total, _rolls) = roll("1d20");
(total, ent)
let (total, _rolls) = roll("1d20");
(total, ent)
}).collect();
commands.spawn(Battle(order));
}