Commit pa que Mon arregle el codi mentre em dutxe

This commit is contained in:
2024-10-09 21:48:01 +02:00
parent 3c1dcad3ab
commit f2fa216b0d
34 changed files with 862 additions and 1218 deletions

View File

@@ -5,10 +5,10 @@
class Texture;
// Constructor
Item::Item(int kind, float x, float y, SDL_Rect *playArea, Texture *texture, std::vector<std::string> *animation)
Item::Item(int kind, float x, float y, SDL_Rect *playArea, std::shared_ptr<Texture> texture, std::vector<std::string> *animation)
: kind(kind), playArea(playArea)
{
sprite = new AnimatedSprite(texture, "", animation);
sprite = std::make_unique<AnimatedSprite>(texture, "", animation);
enabled = true;
timeToLive = 600;
@@ -43,12 +43,6 @@ Item::Item(int kind, float x, float y, SDL_Rect *playArea, Texture *texture, std
shiftColliders();
}
// Destructor
Item::~Item()
{
delete sprite;
}
// Centra el objeto en la posición X
void Item::allignTo(int x)
{