Animations are refactored to let me spawn in an 'attack animation' but I think the data model is wrong. Rather than spawning in an animation every time I can probably just make one, reposition it, then tell it to play. I'll have to try it.

This commit is contained in:
Zed A. Shaw 2025-09-12 11:56:11 -04:00
parent 8384b11993
commit ad3e580495
15 changed files with 109 additions and 56 deletions

View file

@ -4,14 +4,14 @@
#include "easings.hpp"
#include "dinkyecs.hpp"
#include <SFML/Graphics/Rect.hpp>
#include <SFML/Graphics/Sprite.hpp>
namespace animation {
struct AnimationManager {
std::unordered_map<std::string, components::Animation> animations;
};
bool apply(components::Animation& anim, textures::SpriteTexture& target);
bool apply(components::Animation& anim, sf::Sprite& target);
void rotate(sf::Sprite& target, float degrees);
void center(sf::Sprite& target, sf::Vector2f pos);