summary refs log tree commit diff stats
path: root/src/animation_system.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-03 01:35:58 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-03 01:35:58 -0500
commitbe09120d1d044b476ef8b516efbdb526f20d9e2d (patch)
treef935389835d5f94a9cd3bb2059cf55174c9aad69 /src/animation_system.h
parent24918837c3ff9026d228657d14852c9cf39a5644 (diff)
downloadtanetane-be09120d1d044b476ef8b516efbdb526f20d9e2d.tar.gz
tanetane-be09120d1d044b476ef8b516efbdb526f20d9e2d.tar.bz2
tanetane-be09120d1d044b476ef8b516efbdb526f20d9e2d.zip
Added animation system
Diffstat (limited to 'src/animation_system.h')
-rw-r--r--src/animation_system.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/animation_system.h b/src/animation_system.h new file mode 100644 index 0000000..2e13784 --- /dev/null +++ b/src/animation_system.h
@@ -0,0 +1,35 @@
1#ifndef ANIMATION_SYSTEM_H_CCCC7CB8
2#define ANIMATION_SYSTEM_H_CCCC7CB8
3
4#include <string_view>
5#include "direction.h"
6#include "system.h"
7#include "timer.h"
8
9class Game;
10class Renderer;
11
12class AnimationSystem : public System {
13public:
14
15 static constexpr SystemKey Key = SystemKey::Animation;
16
17 AnimationSystem(Game& game) : game_(game) {}
18
19 void tick(double dt) override;
20
21 void initSprite(int spriteId, std::string_view filename, Renderer& renderer);
22
23 void setSpriteDirection(int spriteId, Direction dir);
24
25 void setSpriteAnimation(int spriteId, std::string_view name);
26
27private:
28
29 void updateAnimation(int spriteId);
30
31 Game& game_;
32 Timer animTimer_ {1000/5};//30fps * 1000 t/s;;
33};
34
35#endif /* end of include guard: ANIMATION_SYSTEM_H_CCCC7CB8 */