diff --git a/SeasonsOfLoneliness.cpp b/SeasonsOfLoneliness.cpp index 40f3f35..e83de3d 100644 --- a/SeasonsOfLoneliness.cpp +++ b/SeasonsOfLoneliness.cpp @@ -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 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)); diff --git a/Seasons_of_Loneliness b/Seasons_of_Loneliness index 47ab37f..907df39 100755 Binary files a/Seasons_of_Loneliness and b/Seasons_of_Loneliness differ diff --git a/assets/co2.png b/assets/co2.png new file mode 100644 index 0000000..a9a48aa Binary files /dev/null and b/assets/co2.png differ diff --git a/assets/corn.png b/assets/corn.png new file mode 100644 index 0000000..9f05944 Binary files /dev/null and b/assets/corn.png differ