Tileset animations.

This commit is contained in:
2022-12-07 20:13:59 -08:00
parent 0a4170ea3d
commit 40647ee6c4
16 changed files with 262 additions and 165 deletions

View File

@ -0,0 +1,27 @@
// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "SimpleAnimation.hpp"
#include "scene/components/Components.hpp"
namespace Dawn {
struct TiledSpriteAnimation : public SimpleAnimation<int32_t> {
public:
int32_t frame = 0;
TiledSprite *sprite = nullptr;
TiledSpriteAnimation(TiledSprite *sprite) :
SimpleAnimation(&frame),
sprite(sprite)
{
}
void tick(float_t delta) override {
SimpleAnimation::tick(delta);
this->sprite->setTile(frame);
}
};
}