diff options
author | Alexander Foremny <aforemny@posteo.de> | 2024-03-24 15:01:04 +0100 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2024-03-24 15:01:04 +0100 |
commit | 876fd9d60de9c09e8657a2cb70fd55fd041d1f97 (patch) | |
tree | 8d30385f6b795f706888b036e30506e51985f922 /src/shared/projectile.rs | |
parent | f7428e317d282856d05ffc37b6ba474c5e9973ce (diff) |
feat: color projectiles
Diffstat (limited to 'src/shared/projectile.rs')
-rw-r--r-- | src/shared/projectile.rs | 8 |
1 files changed, 6 insertions, 2 deletions
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,7 +23,6 @@ impl ProjectileBundle { } #[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)] - pub struct Projectile { pub type_: ProjectileType, pub source_player: PlayerId, @@ -29,6 +30,9 @@ pub struct Projectile { } #[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), Instant(InstantProjectile), |