fix: no aparecían nunca diskitos

This commit is contained in:
2024-07-12 18:48:51 +02:00
parent a4dc3d20e2
commit 2ca218c075
6 changed files with 89 additions and 89 deletions

View File

@@ -8,12 +8,12 @@
#define ITEM_H
// Tipos de objetos
#define ITEM_POINTS_1_DISK 0
#define ITEM_POINTS_2_GAVINA 1
#define ITEM_POINTS_3_PACMAR 2
#define ITEM_CLOCK 3
#define ITEM_COFFEE 4
#define ITEM_COFFEE_MACHINE 5
#define ITEM_POINTS_1_DISK 1
#define ITEM_POINTS_2_GAVINA 2
#define ITEM_POINTS_3_PACMAR 3
#define ITEM_CLOCK 4
#define ITEM_COFFEE 5
#define ITEM_COFFEE_MACHINE 6
// Clase Item
class Item
@@ -25,14 +25,14 @@ private:
// Variables
float posX; // Posición X del objeto
float posY; // Posición Y del objeto
Uint8 width; // Ancho del objeto
Uint8 height; // Alto del objeto
int width; // Ancho del objeto
int height; // Alto del objeto
float velX; // Velocidad en el eje X
float velY; // Velocidad en el eje Y
float accelX; // Aceleración en el eje X
float accelY; // Aceleración en el eje Y
bool floorCollision; // Indica si el objeto colisiona con el suelo
Uint8 kind; // Especifica el tipo de objeto que es
int kind; // Especifica el tipo de objeto que es
bool enabled; // Especifica si el objeto está habilitado
circle_t collider; // Circulo de colisión del objeto
@@ -41,11 +41,12 @@ private:
// Actualiza la posición y estados del objeto
void move();
public:
Uint16 timeToLive; // Temporizador con el tiempo que el objeto está presente
// Constructor
Item(Uint8 kind, float x, float y, Texture *texture, std::vector<std::string> *animation, SDL_Renderer *renderer);
Item(int kind, float x, float y, Texture *texture, std::vector<std::string> *animation, SDL_Renderer *renderer);
// Destructor
~Item();
@@ -56,7 +57,6 @@ public:
// Pinta el objeto en la pantalla
void render();
// Pone a cero todos los valores del objeto
void disable();