summaryrefslogtreecommitdiff
path: root/src/components.rs
diff options
context:
space:
mode:
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;