53 lines
1.2 KiB
C++
53 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <SDL2/SDL.h>
|
|
#include "sprite.h"
|
|
|
|
#ifndef COFFEEDROP_H
|
|
#define COFFEEDROP_H
|
|
|
|
#ifndef UNUSED
|
|
|
|
// Clase CoffeeDrop. Gotas de café que aparecen al explotar un globo
|
|
class CoffeeDrop
|
|
{
|
|
private:
|
|
float mPosX; // Posicion en el eje X del objeto
|
|
float mPosY; // Posicion en el eje Y del objeto
|
|
Uint8 mWidth; // Ancho del sprite
|
|
Uint8 mHeight; // Alto del sprite
|
|
float mVelX; // Velocidad en el eje X
|
|
float mVelY; // Velocidad en el eje Y
|
|
float mGravity; // Aceleración en el eje Y
|
|
int mFloor; // Punto donde se encuentra el suelo y desaparecen
|
|
bool mEnabled; // Si esta habilitado. Sirve para saber si se pinta, se actualiza o se puede usar
|
|
Sprite *mSprite; // Puntero al sprite con los graficos
|
|
Uint8 mAlpha;
|
|
|
|
public:
|
|
// Constructor
|
|
CoffeeDrop();
|
|
|
|
// Destructor
|
|
~CoffeeDrop();
|
|
|
|
// Inicializador
|
|
void init(LTexture *texture, SDL_Renderer *renderer, float x, float y, float velX, float velY, int floor);
|
|
|
|
// Actualiza las variables del objeto
|
|
void update();
|
|
|
|
// Pinta el objeto
|
|
void render();
|
|
|
|
// Deshabilita el objeto
|
|
void disable();
|
|
|
|
// Comprueba si està habilitado
|
|
bool isEnabled();
|
|
};
|
|
|
|
#endif
|
|
|
|
#endif
|