From 7e3b59b09399bf8da243fb4122caa2c9c10d2624 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 5 Mar 2021 09:39:31 -0500 Subject: Implemented circle transition effect (for exit area) --- src/effect_system.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/effect_system.cpp') 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) { cameraShakeOffset_.y() = 0; } } + + if (circleEffect_ != circleEffectDest_) { + circleEffectThus_ += dt; + if (circleEffectThus_ >= circleEffectLength_) { + circleEffectThus_ = circleEffectLength_; + } + + circleEffect_ = (circleEffectDest_ - circleEffectStart_) / circleEffectLength_ * circleEffectThus_ + circleEffectStart_; + } } void EffectSystem::fadeScreen(int length, double amount) { @@ -64,3 +73,10 @@ void EffectSystem::stopShakingCamera() { cameraShaking_ = false; cameraShakeOffset_ = { 0, 0 }; } + +void EffectSystem::circleTransition(int length, double amount) { + circleEffectStart_ = circleEffect_; + circleEffectDest_ = amount; + circleEffectLength_ = length; + circleEffectThus_ = 0; +} -- cgit 1.4.1