|
|
|
@ -569,15 +569,18 @@ void Crawler::RenderWorld(float fElapsedTime){ |
|
|
|
|
} |
|
|
|
|
vf2d playerScale=vf2d(player->GetSizeMult(),player->GetSizeMult()); |
|
|
|
|
vf2d playerPosition=player->GetPos(); |
|
|
|
|
#define RENDER_PLAYER \ |
|
|
|
|
if(player->teleportAnimationTimer>0){ \
|
|
|
|
|
playerScale.x=120*abs(pow(player->teleportAnimationTimer-0.175,3)); \
|
|
|
|
|
playerPosition=player->teleportStartPosition.lerp(player->teleportTarget,(0.35-player->teleportAnimationTimer)/0.35); \
|
|
|
|
|
view.DrawPartialRotatedDecal(playerPosition+vf2d{0,-player->GetZ()},player->GetFrame().GetSourceImage()->Decal(),player->GetSpinAngle(),{12,12},player->GetFrame().GetSourceRect().pos,player->GetFrame().GetSourceRect().size,playerScale,player->GetBuffs(BuffType::ATTACK_UP).size()>0?Pixel{255,uint8_t(255*abs(sin(1.4*player->GetBuffs(BuffType::ATTACK_UP)[0].duration))),uint8_t(255*abs(sin(1.4*player->GetBuffs(BuffType::ATTACK_UP)[0].duration)))}:WHITE); \
|
|
|
|
|
} else {view.DrawPartialRotatedDecal(playerPosition+vf2d{0,-player->GetZ()},player->GetFrame().GetSourceImage()->Decal(),player->GetSpinAngle(),{12,12},player->GetFrame().GetSourceRect().pos,player->GetFrame().GetSourceRect().size,playerScale,player->GetBuffs(BuffType::ATTACK_UP).size()>0?Pixel{255,uint8_t(255*abs(sin(1.4*player->GetBuffs(BuffType::ATTACK_UP)[0].duration))),uint8_t(255*abs(sin(1.4*player->GetBuffs(BuffType::ATTACK_UP)[0].duration)))}:WHITE);} |
|
|
|
|
auto RenderPlayer=[&](){ |
|
|
|
|
if(player->teleportAnimationTimer>0){ |
|
|
|
|
playerScale.x=120*abs(pow(player->teleportAnimationTimer-0.175,3)); |
|
|
|
|
playerPosition=player->teleportStartPosition.lerp(player->teleportTarget,(0.35-player->teleportAnimationTimer)/0.35); |
|
|
|
|
view.DrawPartialRotatedDecal(playerPosition+vf2d{0,-player->GetZ()},player->GetFrame().GetSourceImage()->Decal(),player->GetSpinAngle(),{12,12},player->GetFrame().GetSourceRect().pos,player->GetFrame().GetSourceRect().size,playerScale,player->GetBuffs(BuffType::ATTACK_UP).size()>0?Pixel{255,uint8_t(255*abs(sin(1.4*player->GetBuffs(BuffType::ATTACK_UP)[0].duration))),uint8_t(255*abs(sin(1.4*player->GetBuffs(BuffType::ATTACK_UP)[0].duration)))}:WHITE); |
|
|
|
|
} else { |
|
|
|
|
view.DrawPartialRotatedDecal(playerPosition+vf2d{0,-player->GetZ()},player->GetFrame().GetSourceImage()->Decal(),player->GetSpinAngle(),{12,12},player->GetFrame().GetSourceRect().pos,player->GetFrame().GetSourceRect().size,playerScale,player->GetBuffs(BuffType::ATTACK_UP).size()>0?Pixel{255,uint8_t(255*abs(sin(1.4*player->GetBuffs(BuffType::ATTACK_UP)[0].duration))),uint8_t(255*abs(sin(1.4*player->GetBuffs(BuffType::ATTACK_UP)[0].duration)))}:WHITE); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//define end
|
|
|
|
|
if(!player->upperLevel){ |
|
|
|
|
RENDER_PLAYER |
|
|
|
|
RenderPlayer(); |
|
|
|
|
} |
|
|
|
|
if(player->GetState()==State::BLOCK){ |
|
|
|
|
view.DrawDecal(player->GetPos()-vf2d{12,12},GFX_BLOCK_BUBBLE.Decal()); |
|
|
|
@ -661,7 +664,7 @@ void Crawler::RenderWorld(float fElapsedTime){ |
|
|
|
|
m->Draw(); |
|
|
|
|
} |
|
|
|
|
if(player->upperLevel){ |
|
|
|
|
RENDER_PLAYER |
|
|
|
|
RenderPlayer(); |
|
|
|
|
} |
|
|
|
|
for(Monster*m:monstersAfterUpper){ |
|
|
|
|
m->Draw(); |
|
|
|
|