room transition + attack anim

This commit is contained in:
Noel Berry
2021-01-03 14:08:22 -08:00
parent a8b78214f9
commit fb9cebd8ff
15 changed files with 249 additions and 54 deletions

View File

@ -0,0 +1,11 @@
#include "sprite.h"
using namespace TL;
const Sprite::Animation* TL::Sprite::get_animation(const String& name) const
{
for (auto& it : animations)
if (it.name == name)
return ⁢
return nullptr;
}

View File

@ -17,10 +17,20 @@ namespace TL
{
String name;
Vector<Frame> frames;
float duration() const
{
float d = 0;
for (auto& it : frames)
d += it.duration;
return d;
}
};
String name;
Vec2 origin;
Vector<Animation> animations;
const Animation* get_animation(const String& name) const;
};
}