forked from jaildesigner-jailgames/coffee_crisis
78 lines
1.6 KiB
C++
78 lines
1.6 KiB
C++
#pragma once
|
|
#include "ifdefs.h"
|
|
#include "sprite.h"
|
|
|
|
#ifndef MOVINGSPRITE_H
|
|
#define MOVINGSPRITE_H
|
|
|
|
// Clase MovingSprite. Añade posicion y velocidad en punto flotante
|
|
class MovingSprite : public Sprite
|
|
{
|
|
public:
|
|
// Constructor
|
|
MovingSprite();
|
|
|
|
// 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();
|
|
|
|
// Muestra el sprite por pantalla
|
|
void render();
|
|
|
|
// Obten el valor de la variable
|
|
float getPosX();
|
|
|
|
// Obten el valor de la variable
|
|
float getPosY();
|
|
|
|
// Obten el valor de la variable
|
|
float getVelX();
|
|
|
|
// Obten el valor de la variable
|
|
float getVelY();
|
|
|
|
// Obten el valor de la variable
|
|
float getAccelX();
|
|
|
|
// Obten el valor de la variable
|
|
float getAccelY();
|
|
|
|
// Establece el valor de la variable
|
|
void setPosX(float x);
|
|
|
|
// Establece el valor de la variable
|
|
void setPosY(float y);
|
|
|
|
// Establece el valor de la variable
|
|
void setVelX(float x);
|
|
|
|
// Establece el valor de la variable
|
|
void setVelY(float y);
|
|
|
|
// Establece el valor de la variable
|
|
void setAccelX(float x);
|
|
|
|
// Establece el valor de la variable
|
|
void setAccelY(float y);
|
|
|
|
private:
|
|
// Posición
|
|
float mPosX;
|
|
float mPosY;
|
|
|
|
// Velocidad
|
|
float mVelX;
|
|
float mVelY;
|
|
|
|
// Aceleración
|
|
float mAccelX;
|
|
float mAccelY;
|
|
};
|
|
|
|
#endif
|