diff options
author | Alexander Foremny <aforemny@posteo.de> | 2024-03-14 16:10:11 +0100 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2024-03-15 02:50:59 +0100 |
commit | 20fd6cec7ea518a98a4f74f746293eb77c170267 (patch) | |
tree | 35fbe74d020f86cc1a1176340ecdba0433b0bbd6 /src/shared.rs | |
parent | 02750384df3142bda62a7ce0feb08d115aa6af29 (diff) |
feat: shooting
Diffstat (limited to 'src/shared.rs')
-rw-r--r-- | src/shared.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/shared.rs b/src/shared.rs index 5d6cbed..146e343 100644 --- a/src/shared.rs +++ b/src/shared.rs @@ -1,11 +1,15 @@ use crate::protocol::Replicate; +use crate::shared::cooldown::*; use crate::shared::imperative::*; use bevy::prelude::*; use lightyear::prelude::*; use serde::Deserialize; use serde::Serialize; +use std::default::Default; +pub mod cooldown; pub mod imperative; +pub mod projectile; pub const CLIENT_ID: u64 = 0; pub const KEY: [u8; 32] = [ @@ -21,9 +25,10 @@ pub struct PlayerBundle { color: PlayerColor, replicate: Replicate, imperative: Imperative, + cooldown: Cooldown, } -#[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)] +#[derive(Component, Message, Serialize, Deserialize, Clone, Copy, Debug, PartialEq)] pub struct PlayerId(pub ClientId); #[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)] @@ -40,6 +45,7 @@ impl PlayerBundle { color: PlayerColor(color), replicate: Replicate::default(), imperative: Imperative::Idle, + cooldown: Cooldown::default(), } } } |