summary refs log tree commit diff stats
path: root/src/components/animatable.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-02-18 15:25:52 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-02-18 15:25:52 -0500
commite4e2f2d2a7b6a282b9618aa0004d9453936f43c6 (patch)
treede1653dc8b5992420147f28d9fb4de052ea1845f /src/components/animatable.h
parente16fb5be90c889c371cbb0ca2444735c2e12073c (diff)
downloadtherapy-e4e2f2d2a7b6a282b9618aa0004d9453936f43c6.tar.gz
therapy-e4e2f2d2a7b6a282b9618aa0004d9453936f43c6.tar.bz2
therapy-e4e2f2d2a7b6a282b9618aa0004d9453936f43c6.zip
Added player death and event scheduling
Also added ability to make sprites flicker, to freeze physics for an entity, and to freeze progression of a sprite's animation loop.
Diffstat (limited to 'src/components/animatable.h')
-rw-r--r--src/components/animatable.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/components/animatable.h b/src/components/animatable.h index ed0133e..ec72be0 100644 --- a/src/components/animatable.h +++ b/src/components/animatable.h
@@ -51,12 +51,45 @@ public:
51 animation_ = std::move(animation); 51 animation_ = std::move(animation);
52 } 52 }
53 53
54 inline bool isFlickering() const
55 {
56 return flickering_;
57 }
58
59 inline void setFlickering(bool v)
60 {
61 flickering_ = v;
62 }
63
64 inline size_t getFlickerTimer() const
65 {
66 return flickerTimer_;
67 }
68
69 inline void setFlickerTimer(size_t v)
70 {
71 flickerTimer_ = v;
72 }
73
74 inline bool isFrozen() const
75 {
76 return frozen_;
77 }
78
79 inline void setFrozen(bool v)
80 {
81 frozen_ = v;
82 }
83
54private: 84private:
55 85
56 AnimationSet animationSet_; 86 AnimationSet animationSet_;
57 std::string animation_; 87 std::string animation_;
58 size_t frame_ = 0; 88 size_t frame_ = 0;
59 size_t countdown_ = 0; 89 size_t countdown_ = 0;
90 bool flickering_ = false;
91 size_t flickerTimer_ = 0;
92 bool frozen_ = false;
60}; 93};
61 94
62#endif /* end of include guard: SPRITE_RENDERABLE_H_D3AACBBF */ 95#endif /* end of include guard: SPRITE_RENDERABLE_H_D3AACBBF */