diff options
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/cooldown.rs | 15 | ||||
-rw-r--r-- | src/shared/imperative.rs | 3 | ||||
-rw-r--r-- | src/shared/projectile.rs | 17 |
3 files changed, 34 insertions, 1 deletions
diff --git a/src/shared/cooldown.rs b/src/shared/cooldown.rs new file mode 100644 index 0000000..52f41de --- /dev/null +++ b/src/shared/cooldown.rs @@ -0,0 +1,15 @@ +use crate::shared::*; +use bevy::utils::Duration; +use serde::Deserialize; +use serde::Serialize; +use std::default::Default; + +#[derive(Component, Message, Serialize, Deserialize, Clone, Copy, PartialEq, Debug, Default)] +pub struct Cooldown { + pub a_cooldown: Duration, + pub q_cooldown: Duration, + pub w_cooldown: Duration, + pub e_cooldown: Duration, + pub d_cooldown: Duration, + pub f_cooldown: Duration, +} diff --git a/src/shared/imperative.rs b/src/shared/imperative.rs index 1370ddb..d9d727f 100644 --- a/src/shared/imperative.rs +++ b/src/shared/imperative.rs @@ -1,4 +1,4 @@ -use bevy::prelude::*; +use crate::shared::*; use serde::Deserialize; use serde::Serialize; @@ -6,4 +6,5 @@ use serde::Serialize; pub enum Imperative { Idle, WalkTo(Vec2), + Attack(PlayerId), } diff --git a/src/shared/projectile.rs b/src/shared/projectile.rs new file mode 100644 index 0000000..59dec30 --- /dev/null +++ b/src/shared/projectile.rs @@ -0,0 +1,17 @@ +use crate::shared::*; + +#[derive(Bundle)] +pub struct ProjectileBundle { + pub projectile: Projectile, + pub position: ProjectilePosition, + pub replicate: Replicate, +} + +#[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct Projectile { + pub target_player: PlayerId, + pub source_player: PlayerId, +} + +#[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)] +pub struct ProjectilePosition(pub Vec2); |