aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/projectile.rs
blob: c42173aac36f9e34170a1773601e487a4d372de6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use crate::shared::*;

pub const ATTACK_RANGE: f32 = 60.;

#[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,
    pub damage: f32,
}

#[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct ProjectilePosition(pub Vec2);