init commit
This commit is contained in:
32
src/components.rs
Normal file
32
src/components.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
use std::collections::HashMap;
|
||||
use bevy::prelude::*;
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct Health {
|
||||
pub hp: u32,
|
||||
pub max: u32,
|
||||
}
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct Armor {
|
||||
pub ac: u32,
|
||||
}
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct Position {
|
||||
pub x: f32,
|
||||
pub y: f32,
|
||||
}
|
||||
|
||||
#[derive(Bundle)]
|
||||
pub struct Creature {
|
||||
pub health: Health,
|
||||
pub armor: Armor,
|
||||
pub position: Position,
|
||||
}
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct PlayerCharacter;
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct Battle(pub HashMap<u32, Entity>);
|
||||
Reference in New Issue
Block a user