Ya escribe los creditos con colores

This commit is contained in:
2022-10-24 13:17:21 +02:00
parent 591932a928
commit db719245a3
3 changed files with 32 additions and 34 deletions

View File

@@ -53,17 +53,16 @@ void ScoreBoard::render()
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
SDL_RenderFillRect(renderer, &rect);
// Dibuja las vidas
sprite->setPosY(line2);
int index;
const int desp = (counter / 40) % 8;
const int frame = desp % 4;
sprite->setCurrentFrame(frame);
sprite->setPosY(line2);
for (int i = 0; i < board->lives; ++i)
{
sprite->setPosX(8 + (16 * i) + desp);
index = i % color.size();
const int index = i % color.size();
sprite->getTexture()->setColor(color[index].r, color[index].g, color[index].b);
sprite->render();
}