summaryrefslogtreecommitdiff
path: root/src/components.rs
blob: 9b51bc60696f936b1915c18cab43648be98d6908 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use sdl2::rect::Rect;
use specs::prelude::*;
use specs_derive::*;

use crate::math::Vec2;

#[derive(Component, Debug, Clone, Copy)]
pub struct Pos(pub Vec2<f64>);

#[derive(Component, Debug, Clone, Copy)]
pub struct Velocity(pub Vec2<f64>);

#[derive(Component)]
pub struct StaticDrawable
{
    pub texture_name: String,
    pub source_rect:  Rect,
}

#[derive(Component, Default)]
#[storage(NullStorage)]
pub struct Player;