init commit

This commit is contained in:
2023-10-15 23:41:11 -05:00
commit 8677e05fe1
8 changed files with 3853 additions and 0 deletions

15
src/systems.rs Normal file
View File

@@ -0,0 +1,15 @@
use std::collections::HashMap;
use bevy::prelude::*;
use crate::components::*;
use crate::util::roll;
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)
}).collect();
commands.spawn(Battle(order));
}