menudo berenjenal. sigo con la integracion con las ultimas versiones de mis librerias
This commit is contained in:
@@ -10,34 +10,36 @@
|
||||
class MovingSprite : public Sprite
|
||||
{
|
||||
protected:
|
||||
float mPosX; // Posición en el eje X
|
||||
float mPosY; // Posición en el eje Y
|
||||
float x; // Posición en el eje X
|
||||
float y; // Posición en el eje Y
|
||||
|
||||
float mVelX; // Velocidad en el eje X. Cantidad de pixeles a desplazarse
|
||||
float mVelY; // Velocidad en el eje Y. Cantidad de pixeles a desplazarse
|
||||
float xPrev; // Posición anterior en el eje X
|
||||
float yPrev; // Posición anterior en el eje Y
|
||||
|
||||
float mAccelX; // Aceleración en el eje X. Variación de la velocidad
|
||||
float mAccelY; // Aceleración en el eje Y. Variación de la velocidad
|
||||
float vx; // Velocidad en el eje X. Cantidad de pixeles a desplazarse
|
||||
float vy; // Velocidad en el eje Y. Cantidad de pixeles a desplazarse
|
||||
|
||||
float mZoomW; // Zoom aplicado a la anchura
|
||||
float mZoomH; // Zoom aplicado a la altura
|
||||
float ax; // Aceleración en el eje X. Variación de la velocidad
|
||||
float ay; // Aceleración en el eje Y. Variación de la velocidad
|
||||
|
||||
double mAngle; // Angulo para dibujarlo
|
||||
bool mRotate; // Indica si ha de rotar
|
||||
Uint16 mRotateSpeed; // Velocidad de giro
|
||||
double mRotateAmount; // Cantidad de grados a girar en cada iteración
|
||||
Uint16 mCounter; // Contador interno
|
||||
float zoomW; // Zoom aplicado a la anchura
|
||||
float zoomH; // Zoom aplicado a la altura
|
||||
|
||||
double angle; // Angulo para dibujarlo
|
||||
bool rotateEnabled; // Indica si ha de rotar
|
||||
int rotateSpeed; // Velocidad de giro
|
||||
double rotateAmount; // Cantidad de grados a girar en cada iteración
|
||||
int counter; // Contador interno
|
||||
SDL_Point center; // Centro de rotación
|
||||
SDL_RendererFlip currentFlip; // Indica como se voltea el sprite
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
MovingSprite();
|
||||
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();
|
||||
|
||||
// Iniciador
|
||||
void init(float x, float y, int w, int h, float velx, float vely, float accelx, float accely, LTexture *texture, SDL_Renderer *renderer);
|
||||
|
||||
// Mueve el sprite
|
||||
void move();
|
||||
|
||||
@@ -86,44 +88,47 @@ public:
|
||||
// Obtiene el valor de la variable
|
||||
Uint16 getRotateSpeed();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setPosX(float x);
|
||||
// Establece la posición del objeto
|
||||
void setPos(SDL_Rect rect);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setPosY(float y);
|
||||
void setPosX(float value);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setVelX(float x);
|
||||
void setPosY(float value);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setVelY(float y);
|
||||
void setVelX(float value);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setAccelX(float x);
|
||||
void setVelY(float value);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setAccelY(float y);
|
||||
void setAccelX(float value);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setZoomW(float w);
|
||||
void setAccelY(float value);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setZoomH(float h);
|
||||
void setZoomW(float value);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setAngle(double a);
|
||||
void setZoomH(float value);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setAngle(double vaue);
|
||||
|
||||
// Incrementa el valor de la variable
|
||||
void incAngle(double inc);
|
||||
void incAngle(double value);
|
||||
|
||||
// Decrementa el valor de la variable
|
||||
void decAngle(double dec);
|
||||
void decAngle(double value);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setRotate(bool value);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setRotateSpeed(Uint16 value);
|
||||
void setRotateSpeed(int value);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setRotateAmount(double value);
|
||||
@@ -133,6 +138,36 @@ public:
|
||||
|
||||
// Cambia el sentido de la rotación
|
||||
void switchRotate();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setFlip(SDL_RendererFlip flip);
|
||||
|
||||
// Gira el sprite horizontalmente
|
||||
void flip();
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
SDL_RendererFlip getFlip();
|
||||
|
||||
// Devuelve el rectangulo donde está el sprite
|
||||
SDL_Rect getRect();
|
||||
|
||||
// Establece los valores de posición y tamaño del sprite
|
||||
void setRect(SDL_Rect rect);
|
||||
|
||||
// Deshace el último movimiento
|
||||
void undoMove();
|
||||
|
||||
// Deshace el último movimiento en el eje X
|
||||
void undoMoveX();
|
||||
|
||||
// Deshace el último movimiento en el eje Y
|
||||
void undoMoveY();
|
||||
|
||||
// Pone a cero las velocidades de desplacamiento
|
||||
void clearVel();
|
||||
|
||||
// Devuelve el incremento en el eje X en pixels
|
||||
int getIncX();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user