Throw coffe with rotation and time stop with clock sound

This commit is contained in:
2021-04-04 12:31:48 +02:00
parent 4980c0f712
commit d84137daa7
10 changed files with 172 additions and 41 deletions

View File

@@ -8,6 +8,19 @@
// Clase SmartSprite
class SmartSprite : public AnimatedSprite
{
private:
bool mEnabled; // Indica si esta habilitado
bool mIsOnDestination; // Indica si está en el destino
bool mRotate; // Indica si ha de rotar
int mDestX; // Posicion de destino en el eje X
int mDestY; // Posicion de destino en el eje Y
int mId; // Identificador
Uint16 mCounter; // Contador interno
Uint16 mEnabledCounter; // Contador para deshabilitarlo
Uint16 mRotateSpeed; // Velocidad de giro
Uint8 *mIntroEvents; // Dirección del array de eventos donde notificar el estado
double mRotateAmount; // Cantidad de grados a girar en cada iteración
public:
// Constructor
SmartSprite();
@@ -39,15 +52,33 @@ public:
// Establece el valor de la variable
void setDestY(int value);
// Establece el valor de la variable
void setRotate(bool value);
// Establece el valor de la variable
void setRotateSpeed(Uint16 value);
// Establece el valor de la variable
void setRotateAmount(double value);
// Obtiene el valor de la variable
int getDestX();
// Obtiene el valor de la variable
int getDestY();
// Obtiene el valor de la variable
bool getRotate();
// Obtiene el valor de la variable
Uint16 getRotateSpeed();
// Establece la rotacion
void rotate();
// Actualiza la posición y comprueba si ha llegado a su destino
bool update();
// Obtiene el valor de la variable
bool isOnDestination();
@@ -59,26 +90,6 @@ public:
// Establece el valor de la variable
void setIntroEvents(Uint8 *value);
private:
// Indica si esta habilitado
bool mEnabled;
// Contador
Uint16 mEnabledTimer;
// Indica si está en el destino
bool mIsOnDestination;
// Posicion de destino
int mDestX;
int mDestY;
// Identificador
int mId;
// Dirección del array de eventos donde notificar el estado
Uint8 *mIntroEvents;
};
#endif