forked from jaildesigner-jailgames/coffee_crisis
release v1.3 beta 1
This commit is contained in:
185
source/balloon.h
Normal file
185
source/balloon.h
Normal file
@@ -0,0 +1,185 @@
|
||||
#pragma once
|
||||
#include "struct.h"
|
||||
#include "animatedsprite.h"
|
||||
|
||||
#ifndef BALLOON_H
|
||||
#define BALLOON_H
|
||||
|
||||
// Clase globo
|
||||
class Balloon
|
||||
{
|
||||
public:
|
||||
// Constructor
|
||||
Balloon();
|
||||
|
||||
// Destructor
|
||||
~Balloon();
|
||||
|
||||
// Inicializador
|
||||
void init(float x, int y, Uint8 kind, float velx, Uint16 creationtimer, LTexture* texture, SDL_Renderer *renderer);
|
||||
|
||||
// Centra el globo en la posición X
|
||||
void allignTo(int x);
|
||||
|
||||
// Pinta el globo en la pantalla
|
||||
void render();
|
||||
|
||||
// Actualiza la posición y estados del globo
|
||||
void move();
|
||||
|
||||
// Pone a cero todos los valores del globo
|
||||
void erase();
|
||||
|
||||
// Explosiona el globo
|
||||
void pop();
|
||||
|
||||
// Actualiza al globo a su posicion, animación y controla los contadores
|
||||
void update();
|
||||
|
||||
// Establece la animación correspondiente
|
||||
void setAnimation();
|
||||
|
||||
// Comprueba si el globo tiene algun tipo asignado
|
||||
bool isActive();
|
||||
|
||||
// Obtiene del valor de la variable
|
||||
int getPosX();
|
||||
|
||||
// Obtiene del valor de la variable
|
||||
int getPosY();
|
||||
|
||||
// Obtiene del valor de la variable
|
||||
float getVelY();
|
||||
|
||||
// Obtiene del valor de la variable
|
||||
int getWidth();
|
||||
|
||||
// Obtiene del valor de la variable
|
||||
int getHeight();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setVelY(float velY);
|
||||
|
||||
// Obtiene del valor de la variable
|
||||
int getKind();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setStop(bool state);
|
||||
|
||||
// Obtiene del valor de la variable
|
||||
bool isStopped();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setBlink(bool state);
|
||||
|
||||
// Obtiene del valor de la variable
|
||||
bool isBlinking();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setVisible(bool state);
|
||||
|
||||
// Obtiene del valor de la variable
|
||||
bool isVisible();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setInvulnerable(bool state);
|
||||
|
||||
// Obtiene del valor de la variable
|
||||
bool isInvulnerable();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setBeingCreated(bool state);
|
||||
|
||||
// Obtiene del valor de la variable
|
||||
bool isBeingCreated();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setPopping(bool state);
|
||||
|
||||
// Obtiene del valor de la variable
|
||||
bool isPopping();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setTimeToLive(Uint16 time);
|
||||
|
||||
// Obtiene del valor de la variable
|
||||
Uint16 getTimeToLive();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setStoppedTimer(Uint16 time);
|
||||
|
||||
// Obtiene del valor de la variable
|
||||
Uint16 getStoppedTimer();
|
||||
|
||||
// Obtiene del valor de la variable
|
||||
Uint16 getScore();
|
||||
|
||||
// Obtiene el circulo de colisión
|
||||
Circle &getCollider();
|
||||
|
||||
// Obtiene le valor de la variable
|
||||
Uint8 getMenace();
|
||||
|
||||
private:
|
||||
// Posición X,Y del objeto globo
|
||||
float mPosX;
|
||||
int mPosY;
|
||||
|
||||
// Alto y ancho del objeto globo
|
||||
Uint8 mWidth;
|
||||
Uint8 mHeight;
|
||||
|
||||
// Variables para controlar la velocidad del globo
|
||||
float mVelX;
|
||||
float mVelY;
|
||||
float mGravity;
|
||||
float mDefaultVelY;
|
||||
int mMaxVelY;
|
||||
|
||||
// Puntos que da el globo al ser destruido
|
||||
Uint16 mScore;
|
||||
|
||||
// Nivel de amenaza del globo
|
||||
Uint8 mMenace;
|
||||
|
||||
// Indica si el globo está parado
|
||||
bool mStopped;
|
||||
|
||||
// Temporizador para controlar el estado "parado"
|
||||
Uint16 mStoppedTimer;
|
||||
|
||||
// Indica si el globo está intermitente
|
||||
bool mBlinking;
|
||||
|
||||
// Indica si el globo es visible
|
||||
bool mVisible;
|
||||
|
||||
// Indica si el globo es invulnerable
|
||||
bool mInvulnerable;
|
||||
|
||||
// Indica si el globo se está creando
|
||||
bool mBeingCreated;
|
||||
|
||||
// Indica si el globo está explotando
|
||||
bool mPopping;
|
||||
|
||||
// Indica el tiempo de vida que le queda al globo
|
||||
Uint16 mTimeToLive;
|
||||
|
||||
// Temporizador para controlar el estado "creandose"
|
||||
Uint16 mCreationTimer;
|
||||
|
||||
// Tipo de globo
|
||||
Uint8 mKind;
|
||||
|
||||
// Sprite del objeto globo
|
||||
AnimatedSprite *mSprite;
|
||||
|
||||
// Circulo de colisión del objeto
|
||||
Circle mCollider;
|
||||
|
||||
// Alinea el circulo de colisión con la posición del objeto globo
|
||||
void shiftColliders();
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user