diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-15 12:05:18 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-15 12:05:18 -0500 |
commit | d1235174157bd498d0c148325d7c8066e3ab6ac7 (patch) | |
tree | 1f086f5c07ebbf7721d0eb14bed6c86714164dbd /src/effect_system.h | |
parent | ce0628c5ad96e094db12a67d4e98b445fa873ad3 (diff) | |
download | tanetane-d1235174157bd498d0c148325d7c8066e3ab6ac7.tar.gz tanetane-d1235174157bd498d0c148325d7c8066e3ab6ac7.tar.bz2 tanetane-d1235174157bd498d0c148325d7c8066e3ab6ac7.zip |
Added camera shake to lightning event
Diffstat (limited to 'src/effect_system.h')
-rw-r--r-- | src/effect_system.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/effect_system.h b/src/effect_system.h index 2cdcb10..12ec7ca 100644 --- a/src/effect_system.h +++ b/src/effect_system.h | |||
@@ -2,6 +2,8 @@ | |||
2 | #define EFFECT_SYSTEM_H_0B497B39 | 2 | #define EFFECT_SYSTEM_H_0B497B39 |
3 | 3 | ||
4 | #include "system.h" | 4 | #include "system.h" |
5 | #include "timer.h" | ||
6 | #include "vector.h" | ||
5 | 7 | ||
6 | class Game; | 8 | class Game; |
7 | 9 | ||
@@ -26,6 +28,12 @@ public: | |||
26 | // - amount is [0,1] | 28 | // - amount is [0,1] |
27 | void fadeMap(int length, double amount); | 29 | void fadeMap(int length, double amount); |
28 | 30 | ||
31 | // Shakes the viewport by 1 tile in both directions. | ||
32 | // - period is in milliseconds, it's actually a half period | ||
33 | void shakeCamera(int period); | ||
34 | |||
35 | void stopShakingCamera(); | ||
36 | |||
29 | /* Information */ | 37 | /* Information */ |
30 | 38 | ||
31 | bool isScreenFaded() const { return screenFade_ > 0.0; } | 39 | bool isScreenFaded() const { return screenFade_ > 0.0; } |
@@ -40,6 +48,10 @@ public: | |||
40 | 48 | ||
41 | bool isMapFadeComplete() const { return mapFade_ == mapFadeDest_; } | 49 | bool isMapFadeComplete() const { return mapFade_ == mapFadeDest_; } |
42 | 50 | ||
51 | const vec2i& getCameraShakeOffset() const { return cameraShakeOffset_; } | ||
52 | |||
53 | bool isCameraShaking() const { return cameraShaking_; } | ||
54 | |||
43 | private: | 55 | private: |
44 | 56 | ||
45 | Game& game_; | 57 | Game& game_; |
@@ -55,6 +67,11 @@ private: | |||
55 | double mapFadeStart_ = 0.0; | 67 | double mapFadeStart_ = 0.0; |
56 | double mapFadeLength_ = 0.0; | 68 | double mapFadeLength_ = 0.0; |
57 | double mapFadeThus_ = 0.0; | 69 | double mapFadeThus_ = 0.0; |
70 | |||
71 | bool cameraShaking_ = false; | ||
72 | vec2i cameraShakeOffset_ { 0, 0 }; | ||
73 | bool cameraShakeOn_ = false; | ||
74 | Timer cameraShakeTimer_ { 0 }; | ||
58 | }; | 75 | }; |
59 | 76 | ||
60 | #endif /* end of include guard: EFFECT_SYSTEM_H_0B497B39 */ | 77 | #endif /* end of include guard: EFFECT_SYSTEM_H_0B497B39 */ |