Added indicators

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent e4082798c6
commit b00770e985
  1. 23
      SeasonsOfLoneliness.cpp
  2. BIN
      Seasons_of_Loneliness
  3. BIN
      assets/co2.png
  4. BIN
      assets/corn.png

@ -75,8 +75,12 @@ public:
std::string messageBoxRefText;
bool firstNewline=false;
bool secondNewline=false;
bool foodMeterVisible=false;
int foodCount=3;
bool oxygenMeterVisible=false;
int oxygenQualityLevel=34;
olc::Decal*DOME_DECAL;
olc::Decal*DOME_DECAL,*FOOD_METER_DECAL,*OXYGEN_METER_DECAL;
std::map<std::string,olc::Decal*> BASE_OBJECTS;
void LoadMap(char*mapName) {
@ -142,6 +146,8 @@ public:
// Called once at the start, so create things here
TILES=new olc::Decal(new olc::Sprite("assets/tiles.png"));
DOME_DECAL=new olc::Decal(new olc::Sprite("assets/dome.png"));
FOOD_METER_DECAL=new olc::Decal(new olc::Sprite("assets/corn.png"));
OXYGEN_METER_DECAL=new olc::Decal(new olc::Sprite("assets/co2.png"));
BASE_OBJECTS["DOME"]=DOME_DECAL;
LoadMap("assets/maps/map1");
return true;
@ -278,10 +284,12 @@ public:
if (!CUTSCENE_FLAGS[2]) {
CUTSCENE_FLAGS[2]=true;
DisplayMessageBox(2);
foodMeterVisible=true;
} else
if (!CUTSCENE_FLAGS[3]) {
CUTSCENE_FLAGS[3]=true;
DisplayMessageBox(3);
oxygenMeterVisible=true;
}
}
}break;
@ -408,6 +416,19 @@ public:
GradientFillRectDecal({WIDTH/2,HEIGHT/2},{WIDTH/2,HEIGHT/2},{100, 10, 255,ALPHA_SCREEN2},{100, 10, 255,ALPHA_SCREEN1},{100, 10, 255,ALPHA_SCREEN1},{100, 10, 255,ALPHA_SCREEN1});
}break;
}
int meterYOffset=2;
if (foodMeterVisible) {
DrawStringDecal({WIDTH-36*0.4-GetTextSize(to_string(foodCount)).x*1-8,meterYOffset+2},to_string(foodCount),olc::BLUE,{1,1});
DrawStringDecal({WIDTH-36*0.4-GetTextSize(to_string(foodCount)).x*1-7,meterYOffset+2},to_string(foodCount),olc::BLACK,{1,1});
DrawDecal({WIDTH-52*0.4,meterYOffset},FOOD_METER_DECAL,{0.4,0.4});
meterYOffset+=(2+48*0.4);
}
if (oxygenMeterVisible) {
DrawStringDecal({WIDTH-36*0.4-GetTextSize(to_string(oxygenQualityLevel)+"%").x*1-8,meterYOffset+2},to_string(oxygenQualityLevel)+"%",olc::BLUE,{1,1});
DrawStringDecal({WIDTH-36*0.4-GetTextSize(to_string(oxygenQualityLevel)+"%").x*1-7,meterYOffset+2},to_string(oxygenQualityLevel)+"%",olc::BLACK,{1,1});
DrawDecal({WIDTH-52*0.4,meterYOffset},OXYGEN_METER_DECAL,{0.4,0.4});
meterYOffset+=(2+48*0.4);
}
if (messageBoxVisible) {
DrawDialogBox({4,HEIGHT-60},{WIDTH/2,16},olc::Pixel(18, 0, 33,180));
DrawDialogBox({0,HEIGHT-48},{WIDTH,48},olc::Pixel(18, 0, 33,180));

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Loading…
Cancel
Save