migrant .ani a .yaml
This commit is contained in:
@@ -10,8 +10,7 @@
|
||||
|
||||
// Constructor
|
||||
Enemy::Enemy(const Data& enemy)
|
||||
// [DOC:29/10/2025] la surface ara se pillarà del .ANI
|
||||
: sprite_(std::make_shared<SurfaceAnimatedSprite>(/*Resource::Cache::get()->getSurface(enemy.surface_path), */ Resource::Cache::get()->getAnimations(enemy.animation_path))),
|
||||
: sprite_(std::make_shared<SurfaceAnimatedSprite>(Resource::Cache::get()->getAnimationData(enemy.animation_path))),
|
||||
color_string_(enemy.color),
|
||||
x1_(enemy.x1),
|
||||
x2_(enemy.x2),
|
||||
|
||||
@@ -809,8 +809,8 @@ void Player::applySpawnValues(const SpawnData& spawn) {
|
||||
|
||||
// Inicializa el sprite del jugador
|
||||
void Player::initSprite(const std::string& animations_path) {
|
||||
auto animations = Resource::Cache::get()->getAnimations(animations_path);
|
||||
sprite_ = std::make_unique<SurfaceAnimatedSprite>(animations);
|
||||
const auto& animation_data = Resource::Cache::get()->getAnimationData(animations_path);
|
||||
sprite_ = std::make_unique<SurfaceAnimatedSprite>(animation_data);
|
||||
sprite_->setWidth(WIDTH);
|
||||
sprite_->setHeight(HEIGHT);
|
||||
sprite_->setCurrentAnimation("walk");
|
||||
|
||||
Reference in New Issue
Block a user