Implementado el cambio de paleta durante el juego

This commit is contained in:
2022-10-25 21:51:30 +02:00
parent bcb56e17f2
commit dc84ed79d6
31 changed files with 297 additions and 164 deletions

View File

@@ -3,7 +3,7 @@
#include <sstream>
// Constructor
Player::Player(player_t ini, std::string tileset, std::string animation, SDL_Renderer *renderer, Asset *asset, Input *input, Room *room, Debug *debug)
Player::Player(player_t ini, std::string tileset, std::string animation, SDL_Renderer *renderer, Asset *asset, options_t *options, Input *input, Room *room, Debug *debug)
{
// Obten punteros a objetos
this->asset = asset;
@@ -11,13 +11,14 @@ Player::Player(player_t ini, std::string tileset, std::string animation, SDL_Ren
this->input = input;
this->room = room;
this->debug = debug;
this->options = options;
// Crea objetos
texture = new Texture(renderer, asset->get(tileset));
sprite = new AnimatedSprite(texture, renderer, animation);
// Inicializa variables
color = stringToColor("white");
color = stringToColor(options->palette, "white");
onBorder = false;
border = BORDER_TOP;
invincible = false;