1234567891011121314151617181920212223242526 |
- #pragma once
- #include <SFML/Graphics.hpp>
- using namespace sf;
- struct Animation;
- class AnimatedSprite: public Sprite {
- public:
- AnimatedSprite();
- virtual ~AnimatedSprite();
- void addAnimation(std::string armored, std::string filename, unsigned duration, std::string name, bool loop);
- void setAnimation(std::string name, bool armored);
- virtual void animate();
- bool isJumping() const
- {
- return _jumping;
- }
- bool armored;
- protected:
- Animation* _current;
- bool _jumping;
- Clock _anclock;
- private:
- std::map<std::string, Animation> _anim;
- };
|