Transició a surface: vaig per title.cpp

This commit is contained in:
2025-03-02 21:56:19 +01:00
parent db3a0d7263
commit 8f1d1df5d6
27 changed files with 416 additions and 490 deletions

View File

@@ -1,14 +1,14 @@
#include "enemy.h"
#include <SDL2/SDL_render.h> // for SDL_RendererFlip, SDL_FLIP_NONE, SDL_FL...
#include <stdlib.h> // for rand
#include "animated_sprite.h" // for AnimatedSprite
#include "options.h" // for Options, OptionsVideo, options
#include "resource.h" // for Resource
#include "texture.h" // for Texture
#include <SDL2/SDL_render.h> // for SDL_RendererFlip, SDL_FLIP_NONE, SDL_FL...
#include <stdlib.h> // for rand
#include "s_animated_sprite.h" // for AnimatedSprite
#include "options.h" // for Options, OptionsVideo, options
#include "resource.h" // for Resource
#include "surface.h" // for Texture
// Constructor
Enemy::Enemy(const EnemyData &enemy)
: sprite_(std::make_shared<AnimatedSprite>(Resource::get()->getTexture(enemy.texture_path), Resource::get()->getAnimations(enemy.animation_path))),
: sprite_(std::make_shared<AnimatedSprite>(Resource::get()->getSurface(enemy.texture_path), Resource::get()->getAnimations(enemy.animation_path))),
color_string_(enemy.color),
x1_(enemy.x1),
x2_(enemy.x2),