Compare commits

..

2 Commits

  1. 19
      Faceball2030/main.cpp
  2. 2
      Faceball2030/main.h

@ -452,17 +452,18 @@ void FaceBall::RegenerateMinimap(){
try{
MapSquare&square=map.at(y).at(x);
vf2d squareLoc = vf2d{x*minimapGridSize.x,y*minimapGridSize.y};
uint8_t transparency=uint8_t((1-(float(dist)/MAP_VISIBILITY))*255);
if (square.wallN){
DrawLine(squareLoc,squareLoc+vf2d{1.f,0.f}*minimapGridSize,{255,255,255,uint8_t((1-(float(dist)/MAP_VISIBILITY))*255)});
DrawLine(squareLoc,squareLoc+vf2d{1.f,0.f}*minimapGridSize,Pixel{255,255,255,transparency});
}
if (square.wallS){
DrawLine(squareLoc+vf2d{0,1.f}*minimapGridSize,squareLoc+vf2d{1,1}*minimapGridSize,{255,255,255,uint8_t((1-(float(dist)/MAP_VISIBILITY))*255)});
DrawLine(squareLoc+vf2d{0,1.f}*minimapGridSize,squareLoc+vf2d{1,1}*minimapGridSize,Pixel{255,255,255,transparency});
}
if (square.wallE){
DrawLine(squareLoc+vf2d{1,0}*minimapGridSize,squareLoc+vf2d{1,1}*minimapGridSize,{255,255,255,uint8_t((1-(float(dist)/MAP_VISIBILITY))*255)});
DrawLine(squareLoc+vf2d{1,0}*minimapGridSize,squareLoc+vf2d{1,1}*minimapGridSize,Pixel{255,255,255,transparency});
}
if (square.wallW){
DrawLine(squareLoc,squareLoc+vf2d{0,1}*minimapGridSize,{255,255,255,uint8_t((1-(float(dist)/MAP_VISIBILITY))*255)});
DrawLine(squareLoc,squareLoc+vf2d{0,1}*minimapGridSize,Pixel{255,255,255,transparency});
}
if (hasMapUpgrade){
for (Enemy&e:enemies){
@ -479,6 +480,16 @@ void FaceBall::RegenerateMinimap(){
}
}
}
float dist = std::sqrtf(std::pow(player.GetPos().x-exitCoords.x,2)+std::pow(player.GetPos().z-exitCoords.y,2));
if (tagsRemaining>0){
vf2d squareLoc = vf2d{exitCoords.x*minimapGridSize.x,exitCoords.y*minimapGridSize.y};
uint8_t transparency=uint8_t((1-(float(dist)/MAP_VISIBILITY))*255);
DrawLine(squareLoc,squareLoc+vf2d{1.f,0.f}*minimapGridSize,Pixel{DARK_RED.r,DARK_RED.g,DARK_RED.b,transparency});
DrawLine(squareLoc+vf2d{0,1.f}*minimapGridSize,squareLoc+vf2d{1,1}*minimapGridSize,Pixel{DARK_RED.r,DARK_RED.g,DARK_RED.b,transparency});
DrawLine(squareLoc+vf2d{1,0}*minimapGridSize,squareLoc+vf2d{1,1}*minimapGridSize,Pixel{DARK_RED.r,DARK_RED.g,DARK_RED.b,transparency});
DrawLine(squareLoc,squareLoc+vf2d{0,1}*minimapGridSize,Pixel{DARK_RED.r,DARK_RED.g,DARK_RED.b,transparency});
}
FillCircle(vi2d{int(exitCoords.x*minimapGridSize.x+0.5*minimapGridSize.x),int(exitCoords.y*minimapGridSize.x+0.5*minimapGridSize.y)},3,MAGENTA*(1-(float(dist)/MAP_VISIBILITY)));
SetDrawTarget(nullptr);
mapDecal->Update();
}

@ -340,7 +340,7 @@ class FaceBall : public PixelGameEngine
vf2d{1162,575},
vf2d{1163,525}
};
public:
Player player = { {3.7,0.3,0.7}, {{0.5,0.5},0.2} };
vi2d playerRoundedCoords = {int(player.GetPos().x),int(player.GetPos().z)};
const int baseHP = 3;

Loading…
Cancel
Save