Hitbox fade hints implemented for colliding terrain.
This commit is contained in:
+14
-6
@@ -636,12 +636,12 @@ void Crawler::RenderWorld(float fElapsedTime){
|
||||
if(!IsForegroundTile(tileSheet,tileSheetIndex)&&!IsUpperForegroundTile(tileSheetIndex)&&!IsReflectiveTile(tileSheet,tileSheetIndex)){
|
||||
if(layer.tag.data["class"]!="CollisionOnly"){visibleTiles.erase({x,y});}
|
||||
RenderTile({x,y},tileSheet,tileSheetIndex,{tileSheetX,tileSheetY});
|
||||
}
|
||||
if("debug_collision_boxes"_I){
|
||||
if(tileSheet.tileset->collision.find(tileSheetIndex)!=tileSheet.tileset->collision.end()){
|
||||
geom2d::rect<int>collision=tileSheet.tileset->collision[tileSheetIndex].collision;
|
||||
view.FillRectDecal(vi2d{x,y}*24+collision.pos,collision.size,{0,0,0,128});
|
||||
view.DrawRectDecal(vi2d{x,y}*24+collision.pos,collision.size,GREY);
|
||||
if("debug_collision_boxes"_I){
|
||||
if(tileSheet.tileset->collision.find(tileSheetIndex)!=tileSheet.tileset->collision.end()){
|
||||
geom2d::rect<int>collision=tileSheet.tileset->collision[tileSheetIndex].collision;
|
||||
view.FillRectDecal(vi2d{x,y}*24+collision.pos,collision.size,{0,0,0,128});
|
||||
view.DrawRectDecal(vi2d{x,y}*24+collision.pos,collision.size,GREY);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -752,6 +752,14 @@ void Crawler::RenderWorld(float fElapsedTime){
|
||||
}
|
||||
for(TileRenderData&tile:group.GetTiles()){
|
||||
RenderTile(tile,{255,255,255,uint8_t(255-group.fadeFactor/TileGroup::FADE_TIME*TileGroup::FADE_AMT)});
|
||||
float distToPlayer=geom2d::line<float>(player->GetPos(),tile.pos+vf2d{12,12}).length();
|
||||
if(distToPlayer<24*3&&group.fadeFactor>0&&tile.tileSheet.tileset->collision.find(tile.tileID)!=tile.tileSheet.tileset->collision.end()){
|
||||
geom2d::rect<int>collision=tile.tileSheet.tileset->collision[tile.tileID].collision;
|
||||
distToPlayer/=4;
|
||||
if(distToPlayer<1){distToPlayer=1;}
|
||||
view.FillRectDecal(tile.pos+collision.pos,collision.size,{255,0,0,uint8_t(128*group.fadeFactor/sqrt(distToPlayer))});
|
||||
view.DrawRectDecal(tile.pos+collision.pos,collision.size,{128,0,0,uint8_t(255/sqrt(distToPlayer))});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 2
|
||||
#define VERSION_PATCH 0
|
||||
#define VERSION_BUILD 1418
|
||||
#define VERSION_BUILD 1432
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
||||
@@ -303,12 +303,13 @@
|
||||
<tile id="431" type="ForegroundTile"/>
|
||||
<tile id="432" type="ForegroundTile"/>
|
||||
<tile id="433" type="ForegroundTile"/>
|
||||
<tile id="435">
|
||||
<tile id="434" type="ForegroundTile"/>
|
||||
<tile id="435" type="ForegroundTile">
|
||||
<objectgroup draworder="index" id="2">
|
||||
<object id="1" x="0" y="18" width="24" height="6"/>
|
||||
</objectgroup>
|
||||
</tile>
|
||||
<tile id="436">
|
||||
<tile id="436" type="ForegroundTile">
|
||||
<objectgroup draworder="index" id="2">
|
||||
<object id="1" x="0" y="11" width="18" height="13"/>
|
||||
</objectgroup>
|
||||
@@ -322,14 +323,14 @@
|
||||
<object id="1" x="3" y="6" width="19" height="13"/>
|
||||
</objectgroup>
|
||||
</tile>
|
||||
<tile id="459">
|
||||
<tile id="459" type="ForegroundTile">
|
||||
<objectgroup draworder="index" id="2">
|
||||
<object id="1" x="7" y="7" width="17" height="17"/>
|
||||
<object id="1" x="7" y="18" width="17" height="6"/>
|
||||
</objectgroup>
|
||||
</tile>
|
||||
<tile id="460">
|
||||
<tile id="460" type="ForegroundTile">
|
||||
<objectgroup draworder="index" id="2">
|
||||
<object id="1" x="0" y="7" width="13" height="17"/>
|
||||
<object id="1" x="0" y="18" width="13" height="6"/>
|
||||
</objectgroup>
|
||||
</tile>
|
||||
<tile id="461">
|
||||
@@ -356,17 +357,17 @@
|
||||
<tile id="476" type="ForegroundTile"/>
|
||||
<tile id="477" type="ForegroundTile"/>
|
||||
<tile id="478" type="ForegroundTile"/>
|
||||
<tile id="479">
|
||||
<tile id="479" type="ForegroundTile">
|
||||
<objectgroup draworder="index" id="2">
|
||||
<object id="1" x="4" y="0" width="20" height="22"/>
|
||||
</objectgroup>
|
||||
</tile>
|
||||
<tile id="480">
|
||||
<tile id="480" type="ForegroundTile">
|
||||
<objectgroup draworder="index" id="2">
|
||||
<object id="1" x="0" y="0" width="24" height="22"/>
|
||||
</objectgroup>
|
||||
</tile>
|
||||
<tile id="481">
|
||||
<tile id="481" type="ForegroundTile">
|
||||
<objectgroup draworder="index" id="2">
|
||||
<object id="1" x="0" y="0" width="10" height="8"/>
|
||||
</objectgroup>
|
||||
@@ -388,12 +389,12 @@
|
||||
<tile id="501" type="ForegroundTile"/>
|
||||
<tile id="502" type="ForegroundTile"/>
|
||||
<tile id="503" type="ForegroundTile"/>
|
||||
<tile id="504">
|
||||
<tile id="504" type="ForegroundTile">
|
||||
<objectgroup draworder="index" id="2">
|
||||
<object id="1" x="7" y="0" width="17" height="15"/>
|
||||
</objectgroup>
|
||||
</tile>
|
||||
<tile id="505">
|
||||
<tile id="505" type="ForegroundTile">
|
||||
<objectgroup draworder="index" id="2">
|
||||
<object id="1" x="0" y="0" width="16" height="15"/>
|
||||
</objectgroup>
|
||||
@@ -478,12 +479,13 @@
|
||||
<object id="1" x="0" y="0" width="24" height="24"/>
|
||||
</objectgroup>
|
||||
</tile>
|
||||
<tile id="525">
|
||||
<tile id="524" type="ForegroundTile"/>
|
||||
<tile id="525" type="ForegroundTile">
|
||||
<objectgroup draworder="index" id="2">
|
||||
<object id="1" x="0" y="19" width="24" height="5"/>
|
||||
</objectgroup>
|
||||
</tile>
|
||||
<tile id="526">
|
||||
<tile id="526" type="ForegroundTile">
|
||||
<objectgroup draworder="index" id="2">
|
||||
<object id="1" x="0" y="12" width="18" height="12"/>
|
||||
</objectgroup>
|
||||
@@ -557,17 +559,17 @@
|
||||
<object id="1" x="0" y="0" width="18" height="6"/>
|
||||
</objectgroup>
|
||||
</tile>
|
||||
<tile id="569">
|
||||
<tile id="569" type="ForegroundTile">
|
||||
<objectgroup draworder="index" id="2">
|
||||
<object id="1" x="4" y="0" width="20" height="21"/>
|
||||
</objectgroup>
|
||||
</tile>
|
||||
<tile id="570">
|
||||
<tile id="570" type="ForegroundTile">
|
||||
<objectgroup draworder="index" id="2">
|
||||
<object id="1" x="0" y="0" width="24" height="21"/>
|
||||
</objectgroup>
|
||||
</tile>
|
||||
<tile id="571">
|
||||
<tile id="571" type="ForegroundTile">
|
||||
<objectgroup draworder="index" id="2">
|
||||
<object id="1" x="0" y="0" width="9" height="7"/>
|
||||
</objectgroup>
|
||||
|
||||
Reference in New Issue
Block a user