commit de moure a un Linux a gastar eines de home

This commit is contained in:
2025-02-25 19:37:08 +01:00
parent c9da5135b2
commit 32c31a8cb6
28 changed files with 145 additions and 647 deletions

View File

@@ -4,21 +4,22 @@
#include <algorithm> // Para min
#include "animated_sprite.h" // Para AnimatedSprite
#include "texture.h" // Para Texture
#include "resource.h" // Para Resource
#include "options.h" // Para options
// Constructor
Enemy::Enemy(enemy_t enemy)
Enemy::Enemy(EnemyData enemy)
{
// Crea objetos
sprite_ = std::make_shared<AnimatedSprite>(falta_la_textura, enemy.animation);
sprite_ = std::make_shared<AnimatedSprite>(Resource::get()->getTexture(enemy.texture_path), Resource::get()->getAnimation(enemy.animation_path));
// Obten el resto de valores
x1_ = enemy.x1;
x2_ = enemy.x2;
y1_ = enemy.y1;
y2_ = enemy.y2;
palette_ = enemy.palette;
color_string_ = enemy.color;
color_ = stringToColor(palette_, color_string_);
setPalette(options.video.palette);
sprite_->setPosX(enemy.x);
sprite_->setPosY(enemy.y);
sprite_->setVelX(enemy.vx);
@@ -130,6 +131,5 @@ void Enemy::reLoadTexture()
// Asigna la paleta
void Enemy::setPalette(Palette pal)
{
palette_ = pal;
color_ = stringToColor(palette_, color_string_);
color_ = stringToColor(pal, color_string_);
}