summaryrefslogtreecommitdiff
path: root/src/components.rs
diff options
context:
space:
mode:
authorArne Dußin2021-05-07 18:06:02 +0200
committerArne Dußin2021-05-07 18:06:02 +0200
commit6de8cfc84edbc80196ad144f2886031a898f5ed7 (patch)
treeb51d5f147dacce69bbb70bf363067a2528a2601f /src/components.rs
parentf3178df0a92fb3b87087e78cad7b9313f947be6a (diff)
downloadpmd_coop-main.tar.gz
pmd_coop-main.zip
Add player movementHEADmain
Diffstat (limited to 'src/components.rs')
-rw-r--r--src/components.rs17
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;