Trabajando en la INTRO
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "utils.h"
|
||||
#include "animatedsprite.h"
|
||||
#include "utils.h"
|
||||
#include <vector>
|
||||
|
||||
#ifndef SMARTSPRITE_H
|
||||
#define SMARTSPRITE_H
|
||||
@@ -11,13 +12,16 @@
|
||||
class SmartSprite : public AnimatedSprite
|
||||
{
|
||||
private:
|
||||
bool enabled; // Indica si esta habilitado
|
||||
bool onDestination; // Indica si está en el destino
|
||||
int destX; // Posicion de destino en el eje X
|
||||
int destY; // Posicion de destino en el eje Y
|
||||
int id; // Identificador
|
||||
Uint16 enabledCounter; // Contador para deshabilitarlo
|
||||
Uint8 *introEvents; // Dirección del array de eventos donde notificar el estado
|
||||
bool enabled; // Indica si esta habilitado
|
||||
bool onDestination; // Indica si está en el destino
|
||||
int destX; // Posicion de destino en el eje X
|
||||
int destY; // Posicion de destino en el eje Y
|
||||
int id; // Identificador
|
||||
int enabledCounter; // Contador para deshabilitarlo
|
||||
bool finished; // Indica si ya ha terminado
|
||||
|
||||
// Comprueba el movimiento
|
||||
void checkMove();
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
@@ -26,23 +30,29 @@ public:
|
||||
// Destructor
|
||||
~SmartSprite();
|
||||
|
||||
// Actualiza la posición y comprueba si ha llegado a su destino
|
||||
void update();
|
||||
|
||||
// Pinta el objeto en pantalla
|
||||
void render();
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
bool isEnabled();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setEnabled(bool state);
|
||||
void setEnabled(bool enabled);
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
Uint16 getEnabledTimer();
|
||||
int getEnabledCounter();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setEnabledTimer(Uint16 time);
|
||||
void setEnabledCounter(int value);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setDestX(int value);
|
||||
void setDestX(int x);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setDestY(int value);
|
||||
void setDestY(int y);
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
int getDestX();
|
||||
@@ -50,20 +60,17 @@ public:
|
||||
// Obtiene el valor de la variable
|
||||
int getDestY();
|
||||
|
||||
// Actualiza la posición y comprueba si ha llegado a su destino
|
||||
bool update();
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
bool isOnDestination();
|
||||
|
||||
// Pinta el objeto en pantalla
|
||||
void render();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setId(int id);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setIntroEvents(Uint8 *value);
|
||||
// Obtiene el valor de la variable
|
||||
int getId();
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
bool hasFinished();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user