aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/health.rs12
-rw-r--r--src/shared/projectile.rs1
2 files changed, 13 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)
+ }
+}
diff --git a/src/shared/projectile.rs b/src/shared/projectile.rs
index 8dc9da7..c42173a 100644
--- a/src/shared/projectile.rs
+++ b/src/shared/projectile.rs
@@ -13,6 +13,7 @@ pub struct ProjectileBundle {
pub struct Projectile {
pub target_player: PlayerId,
pub source_player: PlayerId,
+ pub damage: f32,
}
#[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)]