Simplify fade in and fade out bullet code. Remove unnecessary variables. Release Build 9483.

mac-build
sigonasr2 6 months ago
parent 3c47cb908e
commit fb6e47fbfa
  1. 8
      Adventures in Lestoria/Bullet.cpp
  2. 1
      Adventures in Lestoria/BulletTypes.h
  3. 3
      Adventures in Lestoria/Tornado.cpp
  4. 2
      Adventures in Lestoria/Version.h
  5. 2
      Adventures in Lestoria/assets/config/MonsterStrategies.txt
  6. BIN
      x64/Release/Adventures in Lestoria.exe

@ -153,11 +153,9 @@ void Bullet::_Update(const float fElapsedTime){
void Bullet::Draw()const{
Pixel blendCol=col;
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(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)));
else 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);

@ -193,7 +193,6 @@ struct Tornado:public Bullet{
float knockbackAmt{};
float fadeInDuration{};
float rot{0.f};
bool fadeOut{false};
Tornado(vf2d centerPoint,float distance,float initialRot,float rotSpd,int damage,const float knockupAmt,const float knockbackAmt,const float lifetime,bool upperLevel,bool friendly=false,Pixel col=WHITE,const vf2d scale={1,1});
void Update(float fElapsedTime)override;
bool PlayerHit(Player*player)override;//DO NOT CALL THIS DIRECTLY! INSTEAD USE _PlayerHit()!!

@ -50,8 +50,7 @@ void Tornado::Update(float fElapsedTime){
pos=centerPoint+polarAngle.cart();
if(lifetime<=0.5f&&!fadeOut){
fadeOut=true;
if(lifetime<=0.5f&&fadeOutTime==0.f){
fadeOutTime=0.5f;
}

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 2
#define VERSION_PATCH 3
#define VERSION_BUILD 9482
#define VERSION_BUILD 9483
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -808,7 +808,7 @@ MonsterStrategy
Attack Duration = 9s
Knockup Duration = 0.7s
Knockback Amount = 2.0
Knockback Amount = 10
Tornado Fade-In Time = 0.5s

Loading…
Cancel
Save