diff --git a/src/components.rs b/src/components.rs index 0111027..0b7f39a 100644 --- a/src/components.rs +++ b/src/components.rs @@ -6,8 +6,8 @@ use specs_derive::Component; /// Entities that have a physical position in the world. #[derive(Component)] pub struct Position { - pub x: usize, - pub y: usize, + pub x: i32, + pub y: i32, } /// Entities that need to be drawn as a single character. diff --git a/src/systems.rs b/src/systems.rs index 7c4d804..c02e2ce 100644 --- a/src/systems.rs +++ b/src/systems.rs @@ -37,8 +37,8 @@ impl<'a> System<'a> for MobSystem { match mob.next_action { MobAction::Nop => {} MobAction::Move(dx, dy) => { - pos.x = (pos.x as i32 + dx) as _; - pos.y = (pos.y as i32 + dy) as _; + pos.x = pos.x + dx; + pos.y = pos.y + dy; } }