Simplify fade in and fade out bullet code. Remove unnecessary variables. Release Build 9483.
This commit is contained in:
parent
d3374062fe
commit
1f8c62188b
@ -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
|
||||
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user