llevat soport per a colors amb nom
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
#include "game/scene_manager.hpp" // Para SceneManager
|
||||
#include "utils/defines.hpp" // Para GameCanvas::CENTER_X
|
||||
#include "utils/delta_timer.hpp" // Para DeltaTimer
|
||||
#include "utils/utils.hpp" // Para PaletteColor, stringToColor
|
||||
#include "utils/utils.hpp"
|
||||
|
||||
// Constructor
|
||||
GameOver::GameOver()
|
||||
@@ -34,13 +34,10 @@ GameOver::GameOver()
|
||||
tv_sprite_->setPosX(GameCanvas::CENTER_X - tv_sprite_->getWidth() - TV_X_OFFSET);
|
||||
tv_sprite_->setPosY(TEXT_Y + SPRITE_Y_OFFSET);
|
||||
|
||||
Screen::get()->setBorderColor(static_cast<Uint8>(PaletteColor::BLACK));
|
||||
Screen::get()->setBorderColor(0);
|
||||
|
||||
// Inicializa el vector de colores (de brillante a oscuro para fade)
|
||||
const std::vector<std::string> COLORS = {"white", "yellow", "cyan", "green", "magenta", "red", "blue", "black"};
|
||||
for (const auto& color : COLORS) {
|
||||
colors_.push_back(stringToColor(color));
|
||||
}
|
||||
colors_ = {14, 12, 10, 8, 6, 4, 2, 0};
|
||||
color_ = colors_.back(); // Empieza en black
|
||||
}
|
||||
|
||||
@@ -64,7 +61,7 @@ void GameOver::update() {
|
||||
// Dibuja el final en pantalla
|
||||
void GameOver::render() {
|
||||
Screen::get()->start();
|
||||
Screen::get()->clearSurface(static_cast<Uint8>(PaletteColor::BLACK));
|
||||
Screen::get()->clearSurface(0);
|
||||
|
||||
auto text = Resource::Cache::get()->getText("smb2");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user