target ui indicating health too (#17)

This commit is contained in:
extrawurst
2025-03-26 00:41:57 +01:00
committed by GitHub
parent 804fac7958
commit 17406b1f00
6 changed files with 214 additions and 13 deletions

View File

@@ -5,12 +5,18 @@ use bevy::prelude::*;
pub use backpack_ui::BackpackAction;
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct BackpackHead {
pub head: usize,
pub health: f32,
}
impl BackpackHead {
pub fn damage(&self) -> f32 {
1. - self.health
}
}
#[derive(Resource, Default)]
pub struct Backpack {
pub heads: Vec<BackpackHead>,