diff options
Diffstat (limited to 'src/effect_system.cpp')
| -rw-r--r-- | src/effect_system.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
| diff --git a/src/effect_system.cpp b/src/effect_system.cpp index aeccebb..4dff13c 100644 --- a/src/effect_system.cpp +++ b/src/effect_system.cpp | |||
| @@ -37,6 +37,15 @@ void EffectSystem::tick(double dt) { | |||
| 37 | cameraShakeOffset_.y() = 0; | 37 | cameraShakeOffset_.y() = 0; |
| 38 | } | 38 | } |
| 39 | } | 39 | } |
| 40 | |||
| 41 | if (circleEffect_ != circleEffectDest_) { | ||
| 42 | circleEffectThus_ += dt; | ||
| 43 | if (circleEffectThus_ >= circleEffectLength_) { | ||
| 44 | circleEffectThus_ = circleEffectLength_; | ||
| 45 | } | ||
| 46 | |||
| 47 | circleEffect_ = (circleEffectDest_ - circleEffectStart_) / circleEffectLength_ * circleEffectThus_ + circleEffectStart_; | ||
| 48 | } | ||
| 40 | } | 49 | } |
| 41 | 50 | ||
| 42 | void EffectSystem::fadeScreen(int length, double amount) { | 51 | void EffectSystem::fadeScreen(int length, double amount) { |
| @@ -64,3 +73,10 @@ void EffectSystem::stopShakingCamera() { | |||
| 64 | cameraShaking_ = false; | 73 | cameraShaking_ = false; |
| 65 | cameraShakeOffset_ = { 0, 0 }; | 74 | cameraShakeOffset_ = { 0, 0 }; |
| 66 | } | 75 | } |
| 76 | |||
| 77 | void EffectSystem::circleTransition(int length, double amount) { | ||
| 78 | circleEffectStart_ = circleEffect_; | ||
| 79 | circleEffectDest_ = amount; | ||
| 80 | circleEffectLength_ = length; | ||
| 81 | circleEffectThus_ = 0; | ||
| 82 | } | ||
