Changed reflection code to slightly account for rotations.
This commit is contained in:
parent
37fb379df9
commit
553baa5945
@ -328,7 +328,29 @@ void Monster::Draw(){
|
|||||||
}
|
}
|
||||||
void Monster::DrawReflection(float drawRatioX,float multiplierX){
|
void Monster::DrawReflection(float drawRatioX,float multiplierX){
|
||||||
game->SetDecalMode(DecalMode::ADDITIVE);
|
game->SetDecalMode(DecalMode::ADDITIVE);
|
||||||
game->view.DrawPartialRotatedDecal(GetPos()+vf2d{drawRatioX*GetFrame().GetSourceRect().size.x,GetZ()+(GetFrame().GetSourceRect().size.y-16)*GetSizeMult()},GetFrame().GetSourceImage()->Decal(),0,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,vf2d(GetSizeMult()*(GetFacingDirection()==RIGHT?-1:1)*multiplierX,GetSizeMult()*-1),GetBuffs(BuffType::SLOWDOWN).size()>0?Pixel{uint8_t(255*abs(sin(1.4*GetBuffs(BuffType::SLOWDOWN)[0].duration))),uint8_t(255*abs(sin(1.4*GetBuffs(BuffType::SLOWDOWN)[0].duration))),uint8_t(128+127*abs(sin(1.4*GetBuffs(BuffType::SLOWDOWN)[0].duration)))}:WHITE);
|
|
||||||
|
vf2d defaultPos=GetPos()+vf2d{drawRatioX*GetFrame().GetSourceRect().size.x,GetZ()+(GetFrame().GetSourceRect().size.y-16)*GetSizeMult()};
|
||||||
|
vf2d spriteSize=GetFrame().GetSourceRect().size/1.5f*GetSizeMult();
|
||||||
|
|
||||||
|
float bottomExpansionAmount=abs(util::radToDeg(spriteRot))/10;
|
||||||
|
|
||||||
|
//BL is in TR, BR is in TL, TR is in BL and TL is in BR.
|
||||||
|
std::array<vf2d,4>points={
|
||||||
|
vf2d{defaultPos+vf2d{-spriteSize.x/2,spriteSize.y}-vf2d{bottomExpansionAmount,0}}, //BL
|
||||||
|
vf2d{defaultPos-spriteSize.x/2}, //TL
|
||||||
|
vf2d{defaultPos+vf2d{spriteSize.x/2,-spriteSize.y/2}}, //TR
|
||||||
|
vf2d{defaultPos+spriteSize/2+vf2d{bottomExpansionAmount,0}}, //BR
|
||||||
|
};
|
||||||
|
if(GetFacingDirection()==RIGHT){
|
||||||
|
points={
|
||||||
|
vf2d{defaultPos+spriteSize/2+vf2d{bottomExpansionAmount,0}}, //BR
|
||||||
|
vf2d{defaultPos+vf2d{spriteSize.x/2,-spriteSize.y/2}}, //TR
|
||||||
|
vf2d{defaultPos-spriteSize.x/2}, //TL
|
||||||
|
vf2d{defaultPos+vf2d{-spriteSize.x/2,spriteSize.y}-vf2d{bottomExpansionAmount,0}}, //BL
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
game->view.DrawPartialWarpedDecal(GetFrame().GetSourceImage()->Decal(),points,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size);
|
||||||
game->SetDecalMode(DecalMode::NORMAL);
|
game->SetDecalMode(DecalMode::NORMAL);
|
||||||
}
|
}
|
||||||
void Monster::Collision(Player*p){
|
void Monster::Collision(Player*p){
|
||||||
|
@ -14,8 +14,6 @@ Settings Menu
|
|||||||
|
|
||||||
- XP Bar
|
- XP Bar
|
||||||
|
|
||||||
- Fix reflections for rotated monsters.
|
|
||||||
|
|
||||||
January 31st
|
January 31st
|
||||||
============
|
============
|
||||||
Make new unlocked nodes more obvious, made neighboring nodes more obvious
|
Make new unlocked nodes more obvious, made neighboring nodes more obvious
|
||||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
|||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 3
|
#define VERSION_MINOR 3
|
||||||
#define VERSION_PATCH 0
|
#define VERSION_PATCH 0
|
||||||
#define VERSION_BUILD 6238
|
#define VERSION_BUILD 6261
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="200" height="250" tilewidth="24" tileheight="24" infinite="0" nextlayerid="8" nextobjectid="96">
|
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="200" height="250" tilewidth="24" tileheight="24" infinite="0" nextlayerid="8" nextobjectid="97">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
|
<property name="Backdrop" propertytype="Backdrop" value="forest"/>
|
||||||
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
|
<property name="Background Music" propertytype="BGM" value="foresty1_1"/>
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.5 KiB |
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user