Add player velocity adjustment function. Add Wind attack functionality for second bonus boss. Add overlay ease-in transparency. Release Build 9494.
This commit is contained in:
@@ -39,10 +39,13 @@ All rights reserved.
|
||||
#include "DEFINES.h"
|
||||
#include "AdventuresInLestoria.h"
|
||||
#include "Overlay.h"
|
||||
#include "util.h"
|
||||
|
||||
INCLUDE_game
|
||||
INCLUDE_ANIMATION_DATA
|
||||
|
||||
const float Overlay::ALPHA_TIME{0.5f};
|
||||
|
||||
Overlay::Overlay(std::string animationName,Pixel overlayCol)
|
||||
:animationName(animationName),overlayCol(overlayCol){}
|
||||
const Pixel&Overlay::GetOverlayCol()const{
|
||||
@@ -52,15 +55,22 @@ void Overlay::SetOverlayCol(Pixel newOverlayCol){
|
||||
overlayCol=newOverlayCol;
|
||||
}
|
||||
void Overlay::Enable(){
|
||||
alpha=0;
|
||||
alphaTimer=0.f;
|
||||
enabled=true;
|
||||
}
|
||||
void Overlay::Disable(){
|
||||
alpha=255;
|
||||
alphaTimer=0.f;
|
||||
enabled=false;
|
||||
}
|
||||
void Overlay::Draw(){
|
||||
if(!enabled)return;
|
||||
alphaTimer+=game->GetElapsedTime();
|
||||
if(enabled)alpha=util::lerp(0,255,std::min(1.f,alphaTimer/ALPHA_TIME));
|
||||
else alpha=util::lerp(255,0,std::min(1.f,alphaTimer/ALPHA_TIME));
|
||||
|
||||
const Animate2D::Frame&animationFrame{ANIMATION_DATA.at(animationName).GetFrame(game->GetRunTime())};
|
||||
game->DrawPartialDecal({},animationFrame.GetSourceRect().size,animationFrame.GetSourceImage()->Decal(),animationFrame.GetSourceRect().pos,animationFrame.GetSourceRect().size,overlayCol);
|
||||
game->DrawPartialDecal({},animationFrame.GetSourceRect().size,animationFrame.GetSourceImage()->Decal(),animationFrame.GetSourceRect().pos,animationFrame.GetSourceRect().size,{overlayCol.r,overlayCol.g,overlayCol.b,uint8_t(overlayCol.a*uint8_t(alpha/255.f))});
|
||||
}
|
||||
void Overlay::Reset(){
|
||||
animationName="pixel.png";
|
||||
|
||||
Reference in New Issue
Block a user