Prepended zeroes for launch amount display

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent 67485b006d
commit 9e1b9aa974
  1. 4
      Board.cpp
  2. BIN
      C++ProjectTemplate
  3. 12
      main.cpp

@ -18,7 +18,7 @@ maxWarningLevel(maxWarningLevel){
}
clumps.reserve(100);
BlockClump newClump;
/*BlockClump newClump;
BlockClump newClump2;
newClump.addBlock(2,0,BlockColor::WHITE);
newClump.addBlock(1,0,BlockColor::BLUE);
@ -34,7 +34,7 @@ maxWarningLevel(maxWarningLevel){
newClump.y=100;
newClump2.y=100;
clumps.push_back(newClump);
clumps.push_back(newClump2);
clumps.push_back(newClump2);*/
}
void Board::spawnBlock(int col){

Binary file not shown.

@ -133,7 +133,7 @@ void Meteos::spawnBlocks(float fElapsedTime){
lastBlockSpawn+=fElapsedTime;
if (lastBlockSpawn>=gameBoard.spawnRate){
lastBlockSpawn-=gameBoard.spawnRate;
//gameBoard.spawnBlock(randBlockPos(gen));
gameBoard.spawnBlock(randBlockPos(gen));
}
}
@ -984,7 +984,15 @@ void Meteos::drawGame(float fElapsedTime,bool debugView){
DrawStringDecal(gameBoard.drawOffset+vi2d{0,-8},"+"+std::to_string(accumulatedScore),frameTime%5>2?Pixel{224, 184, 148}:WHITE,{0.75,0.75});
GradientFillRectDecal(gameBoard.drawOffset+vi2d{gameBoard.boardSize.x*12+16,0}, {32,32}, BLACK, VERY_DARK_GREEN, VERY_DARK_GREEN, BLACK);
DrawRectDecal(gameBoard.drawOffset+vi2d{gameBoard.boardSize.x*12+16,0}, {32,32}, DARK_YELLOW);
DrawStringDecal(gameBoard.drawOffset+vi2d{gameBoard.boardSize.x*12+16,8},std::to_string(blocksInAttackQueue),{66, 125, 92});
std::string attackQueueDisplay="";
if (blocksInAttackQueue<100){
attackQueueDisplay+='0';
}
if (blocksInAttackQueue<10){
attackQueueDisplay+='0';
}
attackQueueDisplay+=std::to_string(blocksInAttackQueue);
DrawStringDecal(gameBoard.drawOffset-vf2d{GetTextSize(attackQueueDisplay).x*0.85f/2,0}+vi2d{gameBoard.boardSize.x*12+16+16,3},attackQueueDisplay,{66, 125, 92},{0.85,1});
}
}

Loading…
Cancel
Save