From 876fd9d60de9c09e8657a2cb70fd55fd041d1f97 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Sun, 24 Mar 2024 15:01:04 +0100 Subject: feat: color projectiles --- src/shared/projectile.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/shared/projectile.rs') diff --git a/src/shared/projectile.rs b/src/shared/projectile.rs index 5da0526..8fd0070 100644 --- a/src/shared/projectile.rs +++ b/src/shared/projectile.rs @@ -5,13 +5,15 @@ use crate::shared::*; #[derive(Bundle)] pub struct ProjectileBundle { pub projectile: Projectile, + pub projectile_color: ProjectileColor, pub replicate: Replicate, } impl ProjectileBundle { - pub fn new(projectile: Projectile) -> Self { + pub fn new(projectile: Projectile, projectile_color: ProjectileColor) -> Self { ProjectileBundle { projectile, + projectile_color: projectile_color, replicate: Replicate { replication_group: ReplicationGroup::default().set_priority(1.), ..Default::default() @@ -21,13 +23,15 @@ impl ProjectileBundle { } #[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)] - pub struct Projectile { pub type_: ProjectileType, pub source_player: PlayerId, pub damage: Damage, } +#[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ProjectileColor(pub Color); + #[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)] pub enum ProjectileType { Free(FreeProjectile), -- cgit v1.2.3