aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/projectile.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/projectile.rs')
-rw-r--r--src/shared/projectile.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/shared/projectile.rs b/src/shared/projectile.rs
index f944e8a..772f5d9 100644
--- a/src/shared/projectile.rs
+++ b/src/shared/projectile.rs
@@ -1,3 +1,4 @@
+use crate::shared::player::*;
use crate::shared::*;
#[derive(Bundle)]
@@ -6,6 +7,18 @@ pub struct ProjectileBundle {
pub replicate: Replicate,
}
+impl ProjectileBundle {
+ pub fn new(projectile: Projectile) -> Self {
+ ProjectileBundle {
+ projectile,
+ replicate: Replicate {
+ replication_group: ReplicationGroup::default().set_priority(1.),
+ ..Default::default()
+ },
+ }
+ }
+}
+
#[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct Projectile {