geometry::Vector<float> &Velocity() { return velocity; }
const geometry::Vector<float> &Velocity() const { return velocity; }
- void SetSprite(const graphics::Sprite *s) { sprite = s; }
- graphics::AnimationRunner &Animation() { return animation; }
- const graphics::AnimationRunner &Animation() const { return animation; }
+ void SetAnimation(const graphics::Animation *a);
+ void StartAnimation(app::Application &ctrl);
+ void StartAnimation(app::State &ctrl);
+ void StopAnimation();
+ bool AnimationRunning() const { return runner.Running(); }
void SetOrientation(Orientation);
Orientation GetOrientation() const { return orientation; }
void SetSpeed(float);
+ Entity *Follower() { return follower; }
+ const Entity *Follower() const { return follower; }
+ void AddFollower(Entity *);
+ void RemoveFollower(Entity *);
+
bool TileLock(int width, int height) const;
void Update(float deltaT);
void Render(SDL_Surface *, const geometry::Vector<int> &offset) const;
private:
- void UpdateVelocity();
+ void UpdateVelocity();;
private:
- const graphics::Sprite *sprite;
- graphics::AnimationRunner animation;
+ Entity *follower;
+ const graphics::Animation *animation;
+ graphics::AnimationRunner runner;
geometry::Vector<float> position;
geometry::Vector<float> velocity;
Orientation orientation;