- geometry::Vector<float> &Position() { return position; }
- const geometry::Vector<float> &Position() const { return position; }
-
- geometry::Vector<float> &Velocity() { return velocity; }
- const geometry::Vector<float> &Velocity() const { return velocity; }
-
- geometry::Vector<int> &SpriteOffset() { return spriteOffset; }
- const geometry::Vector<int> &SpriteOffset() const { return spriteOffset; }
-
+ /// Pixel resolved position of the entity's top left corner on the map.
+ math::Vector<math::Fixed<8> > &Position() { return position; }
+ const math::Vector<math::Fixed<8> > &Position() const { return position; }
+
+ /// Velocity of the entity in pixels per second.
+ math::Vector<math::Fixed<8> > &Velocity() { return velocity; }
+ const math::Vector<math::Fixed<8> > &Velocity() const { return velocity; }
+
+ /// Offset of the entity's sprite's to left corner relative to Position().
+ math::Vector<int> &SpriteOffset() { return spriteOffset; }
+ const math::Vector<int> &SpriteOffset() const { return spriteOffset; }
+
+ /// Reset the entity to the stored tile coordinates (usually set when
+ /// loading game data).
+ void ResetPosition(const math::Vector<int> &tileSize) { position = tilePosition * tileSize; }
+
+ /// Set the animation to use for animated entities.
+ /// For orientable entities, the animation should have north, south, east,
+ /// and west sprites at offsets (0,0), (1,0), (2,0), and (3,0) respectively.
+ /// If the entity can carry, row offset 2 is used.
+ /// If the entity can push, row offset 4 is used.