diff options
| author | Arne Dußin | 2021-05-07 18:06:02 +0200 |
|---|---|---|
| committer | Arne Dußin | 2021-05-07 18:06:02 +0200 |
| commit | 6de8cfc84edbc80196ad144f2886031a898f5ed7 (patch) | |
| tree | b51d5f147dacce69bbb70bf363067a2528a2601f /src/components.rs | |
| parent | f3178df0a92fb3b87087e78cad7b9313f947be6a (diff) | |
| download | pmd_coop-main.tar.gz pmd_coop-main.zip | |
Diffstat (limited to 'src/components.rs')
| -rw-r--r-- | src/components.rs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/components.rs b/src/components.rs index c92ca03..9b51bc6 100644 --- a/src/components.rs +++ b/src/components.rs @@ -1,15 +1,22 @@ +use sdl2::rect::Rect; use specs::prelude::*; use specs_derive::*; +use crate::math::Vec2; + #[derive(Component, Debug, Clone, Copy)] -pub struct Pos -{ - pub x: f64, - pub y: f64, -} +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; |
