Me voy a la cama. Sigo con la reescritura de todo el código

This commit is contained in:
2022-09-26 22:25:46 +02:00
parent 35e7abcd3c
commit c8bebfd2d9
74 changed files with 365 additions and 379 deletions

View File

@@ -2,22 +2,11 @@
#include "balloon.h"
// Constructor
Balloon::Balloon()
Balloon::Balloon(float x, float y, Uint8 kind, float velx, float speed, Uint16 creationtimer, LTexture *texture, SDL_Renderer *renderer)
{
mSprite = new AnimatedSprite();
disable();
}
// Destructor
Balloon::~Balloon()
{
delete mSprite;
mSprite = nullptr;
}
// Inicializador
void Balloon::init(float x, float y, Uint8 kind, float velx, float speed, Uint16 creationtimer, LTexture *texture, SDL_Renderer *renderer)
{
const Uint8 NUM_FRAMES_BALLON = 10;
const Uint8 NUM_FRAMES_BALLON_POP = 12;
const Uint8 NUM_FRAMES_BALLON_BORN = 10;
@@ -435,6 +424,13 @@ void Balloon::init(float x, float y, Uint8 kind, float velx, float speed, Uint16
mSprite->setSpriteClip(mSprite->getAnimationClip(0, 0));
}
// Destructor
Balloon::~Balloon()
{
delete mSprite;
mSprite = nullptr;
}
// Centra el globo en la posición X
void Balloon::allignTo(int x)
{