Retocadas las clases Sprite e hijas

This commit is contained in:
2022-07-12 17:32:12 +02:00
parent 834d3a09a4
commit ae841a45ee
6 changed files with 91 additions and 71 deletions

View File

@@ -31,43 +31,7 @@ protected:
public:
// Constructor
MovingSprite(float x, float y, int w, int h, float velx, float vely, float accelx, float accely, LTexture *texture, SDL_Renderer *renderer)
: Sprite((int)x, (int)y, w, h, texture, renderer)
{
// Establece el alto y el ancho del sprite
setWidth(w);
setHeight(h);
// Establece la posición X,Y del sprite
setPosX(x);
setPosY(y);
// Establece la velocidad X,Y del sprite
setVelX(velx);
setVelY(vely);
// Establece la aceleración X,Y del sprite
setAccelX(accelx);
setAccelY(accely);
// Establece el zoom W,H del sprite
setZoomW(1);
setZoomH(1);
// Establece el angulo con el que se dibujará
setAngle(0.0);
// Establece los valores de rotacion
setRotate(false);
setRotateSpeed(0);
setRotateAmount(0.0);
// Contador interno
mCounter = 0;
// Establece el rectangulo de donde coger la imagen
setSpriteClip(0, 0, w, h);
};
MovingSprite(float x = 0, float y = 0, int w = 0, int h = 0, float velx = 0, float vely = 0, float accelx = 0, float accely = 0, LTexture *texture = nullptr, SDL_Renderer *renderer = nullptr);
// Destructor
~MovingSprite();