Bullet fade in timer effects added. Added Tornado rings for second bonus boss. Release Build 9455.

This commit is contained in:
2024-05-28 11:25:24 -05:00
parent b956a103df
commit bbdef1cdfb
10 changed files with 65 additions and 23 deletions
+18 -1
View File
@@ -61,6 +61,12 @@ Animate2D::Frame Bullet::GetFrame()const{
}
void Bullet::UpdateFadeTime(float fElapsedTime)
{
if(fadeInTime>0){
if(fadeInTimer<fadeInTime){
fadeInTimer=std::min(fadeInTime,fadeInTimer+fElapsedTime);
if(fadeInTimer==fadeInTime)deactivated=false;
}
}
if(fadeOutTime>0){
if(fadeOutTimer==0){
lifetime=fadeOutTime;
@@ -144,7 +150,11 @@ void Bullet::_Update(const float fElapsedTime){
void Bullet::Draw()const{
Pixel blendCol=col;
blendCol.a=fadeOutTime==0?col.a:uint8_t(util::lerp(col.a,0,1-((fadeOutTime-fadeOutTimer)/fadeOutTime)));
if(fadeInTime==0&&fadeOutTime==0){
blendCol.a=col.a;
}else
if(fadeOutTime>0)blendCol.a=uint8_t(util::lerp(col.a,0,1-((fadeOutTime-fadeOutTimer)/fadeOutTime)));
if(fadeInTime>0)blendCol.a=uint8_t(util::lerp(col.a,0,((fadeInTime-fadeInTimer)/fadeInTime)));
if(GetZ()>0){
vf2d shadowScale=vf2d{8*scale.x/3.f,1}/std::max(1.f,GetZ()/8);
@@ -191,4 +201,11 @@ const float Bullet::GetZ()const{
Bullet&Bullet::SetIframeTimeOnHit(float iframeTimer){
iframeTimerOnHit=iframeTimer;
return *this;
}
Bullet&Bullet::SetFadeinTime(float fadeInTime){
const float durationDiff=fadeInTime-fadeInTimer;
this->fadeInTime=fadeInTime;
lifetime+=durationDiff;
deactivated=true;
return *this;
}