The class looks primarily good, I like that you use RAII and don't inherit from
sf::Sprite Still some advice, as requested:
Make your code const-correct. Top-level CV qualifiers for parameters like
const std::size_t n are useless, as explained
here.
std::size_t getSize();
// -->
std::size_t getSize() const;
sf::IntRect& getFrame(const std::size_t n);
// ->
sf::IntRect getFrame(std::size_t n) const; // or
const sf::IntRect& getFrame(std::size_t n) const;
And if the animation isn't modified in the animated sprite, you can make the pointers and references to it const, too.
AnimatedSprite's constructor should be explicit, and you should initialize everything in its initializer list. Also, it's not exactly clear in which cases you cast
int to
float... Basically, there exists an implicit conversion, but to make it expressive in the code, you can (but don't have to) use
static_cast.