aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/health.rs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-15 14:04:17 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-15 14:25:01 +0100
commitfdee6aa8cf2c51d5004d914458ff661da366e883 (patch)
tree0c022856e64e72a00305e28a684e139696c297ab /src/shared/health.rs
parent1e162629da53373f0e2502014d42c7636412e67e (diff)
feat: add health/ damage
Diffstat (limited to 'src/shared/health.rs')
-rw-r--r--src/shared/health.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/shared/health.rs b/src/shared/health.rs
new file mode 100644
index 0000000..f4a288a
--- /dev/null
+++ b/src/shared/health.rs
@@ -0,0 +1,12 @@
+use crate::shared::*;
+
+#[derive(Component, Message, Serialize, Deserialize, Clone, Copy, Debug, PartialEq)]
+pub struct Health(pub f32);
+
+pub const MAX_HEALTH: f32 = 100.;
+
+impl Default for Health {
+ fn default() -> Self {
+ Health(MAX_HEALTH)
+ }
+}