Canviada la classe bullet per la de chatGPT, aixina demà ho mire amb calma
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
#include "balloon.h"
|
#include "balloon.h"
|
||||||
#include <bits/std_abs.h> // for abs
|
|
||||||
#include <math.h> // for abs
|
#include <math.h> // for abs
|
||||||
#include "animated_sprite.h" // for AnimatedSprite
|
#include "animated_sprite.h" // for AnimatedSprite
|
||||||
#include "moving_sprite.h" // for MovingSprite
|
#include "moving_sprite.h" // for MovingSprite
|
||||||
|
|||||||
@@ -1,217 +1,98 @@
|
|||||||
#include "bullet.h"
|
#include "bullet.h"
|
||||||
#include "param.h" // for param
|
#include "param.h" // for param
|
||||||
#include "sprite.h" // for Sprite
|
#include "sprite.h" // for Sprite
|
||||||
class Texture;
|
#include <memory> // for std::unique_ptr
|
||||||
|
|
||||||
|
// Constantes evaluables en tiempo de compilación
|
||||||
|
constexpr int BULLET_WIDTH = 12;
|
||||||
|
constexpr int BULLET_HEIGHT = 12;
|
||||||
|
constexpr int BULLET_VELY = -3;
|
||||||
|
constexpr int BULLET_VELX_LEFT = -2;
|
||||||
|
constexpr int BULLET_VELX_RIGHT = 2;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
Bullet::Bullet(int x, int y, int kind, bool poweredUp, int owner, SDL_Rect *playArea, Texture *texture)
|
Bullet::Bullet(int x, int y, BulletType kind, bool poweredUp, int owner, SDL_Rect* playArea, Texture* texture)
|
||||||
|
: posX(x), posY(y), width(BULLET_WIDTH), height(BULLET_HEIGHT), velX(0), velY(BULLET_VELY),
|
||||||
|
kind(kind), owner(owner), playArea(playArea),
|
||||||
|
sprite(std::unique_ptr<Sprite>(new Sprite(SDL_Rect{x, y, BULLET_WIDTH, BULLET_HEIGHT}, texture))) // Crear manualmente el std::unique_ptr
|
||||||
{
|
{
|
||||||
// Rectangulo con la zona de juego
|
velX = (kind == BulletType::LEFT) ? BULLET_VELX_LEFT : (kind == BulletType::RIGHT) ? BULLET_VELX_RIGHT : 0;
|
||||||
this->playArea = playArea;
|
|
||||||
|
|
||||||
// Posición inicial del objeto
|
auto spriteOffset = poweredUp ? 3 : 0;
|
||||||
posX = x;
|
auto kindIndex = static_cast<int>(kind);
|
||||||
posY = y;
|
sprite->setSpriteClip((kindIndex + spriteOffset) * width, 0, sprite->getWidth(), sprite->getHeight());
|
||||||
|
|
||||||
// Alto y ancho del objeto
|
|
||||||
width = 12;
|
|
||||||
height = 12;
|
|
||||||
|
|
||||||
// Crea el sprite
|
|
||||||
sprite = new Sprite({x, y, width, height}, texture);
|
|
||||||
|
|
||||||
// Velocidad inicial en el eje Y
|
|
||||||
velY = -3;
|
|
||||||
|
|
||||||
// Tipo de bala
|
|
||||||
this->kind = kind;
|
|
||||||
|
|
||||||
// Identificador del dueño del objeto
|
|
||||||
this->owner = owner;
|
|
||||||
|
|
||||||
// Valores especificos según el tipo
|
|
||||||
switch (kind)
|
|
||||||
{
|
|
||||||
case BULLET_UP:
|
|
||||||
// Establece la velocidad inicial
|
|
||||||
velX = 0;
|
|
||||||
|
|
||||||
// Rectangulo con los gráficos del objeto
|
|
||||||
if (!poweredUp)
|
|
||||||
{
|
|
||||||
sprite->setSpriteClip(0 * width, 0, sprite->getWidth(), sprite->getHeight());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sprite->setSpriteClip((0 + 3) * width, 0, sprite->getWidth(), sprite->getHeight());
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BULLET_LEFT:
|
|
||||||
// Establece la velocidad inicial
|
|
||||||
velX = -2;
|
|
||||||
|
|
||||||
// Rectangulo con los gráficos del objeto
|
|
||||||
if (!poweredUp)
|
|
||||||
{
|
|
||||||
sprite->setSpriteClip(1 * width, 0, sprite->getWidth(), sprite->getHeight());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sprite->setSpriteClip((1 + 3) * width, 0, sprite->getWidth(), sprite->getHeight());
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BULLET_RIGHT:
|
|
||||||
// Establece la velocidad inicial
|
|
||||||
velX = 2;
|
|
||||||
|
|
||||||
// Rectangulo con los gráficos del objeto
|
|
||||||
if (!poweredUp)
|
|
||||||
{
|
|
||||||
sprite->setSpriteClip(2 * width, 0, sprite->getWidth(), sprite->getHeight());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sprite->setSpriteClip((2 + 3) * width, 0, sprite->getWidth(), sprite->getHeight());
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Establece el tamaño del circulo de colisión
|
|
||||||
collider.r = width / 2;
|
collider.r = width / 2;
|
||||||
|
|
||||||
// Alinea el circulo de colisión con el objeto
|
|
||||||
shiftColliders();
|
shiftColliders();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Destructor
|
// Implementación de render (llama al render del sprite)
|
||||||
Bullet::~Bullet()
|
void Bullet::render() {
|
||||||
{
|
|
||||||
delete sprite;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pinta el objeto en pantalla
|
|
||||||
void Bullet::render()
|
|
||||||
{
|
|
||||||
sprite->render();
|
sprite->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actualiza la posición y estado del objeto en horizontal
|
// Implementación del movimiento usando BulletMoveStatus
|
||||||
Uint8 Bullet::move()
|
BulletMoveStatus Bullet::move() {
|
||||||
{
|
|
||||||
// Variable con el valor de retorno
|
|
||||||
Uint8 msg = BULLET_MOVE_OK;
|
|
||||||
|
|
||||||
// Mueve el objeto a su nueva posición
|
|
||||||
posX += velX;
|
posX += velX;
|
||||||
|
if (posX < param.game.playArea.rect.x - width || posX > playArea->w) {
|
||||||
// Si el objeto se sale del area de juego por los laterales
|
disable();
|
||||||
if ((posX < param.game.playArea.rect.x - width) || (posX > playArea->w))
|
return BulletMoveStatus::OUT;
|
||||||
{
|
|
||||||
// Se deshabilita
|
|
||||||
kind = BULLET_NULL;
|
|
||||||
|
|
||||||
// Mensaje de salida
|
|
||||||
msg = BULLET_MOVE_OUT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mueve el objeto a su nueva posición en vertical
|
posY += velY;
|
||||||
posY += int(velY);
|
if (posY < param.game.playArea.rect.y - height) {
|
||||||
|
disable();
|
||||||
// Si el objeto se sale del area de juego por la parte superior
|
return BulletMoveStatus::OUT;
|
||||||
if (posY < param.game.playArea.rect.y - height)
|
|
||||||
{
|
|
||||||
// Se deshabilita
|
|
||||||
kind = BULLET_NULL;
|
|
||||||
|
|
||||||
// Mensaje de salida
|
|
||||||
msg = BULLET_MOVE_OUT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actualiza la posición del sprite
|
|
||||||
sprite->setPosX(posX);
|
sprite->setPosX(posX);
|
||||||
sprite->setPosY(posY);
|
sprite->setPosY(posY);
|
||||||
|
|
||||||
// Alinea el circulo de colisión con el objeto
|
|
||||||
shiftColliders();
|
shiftColliders();
|
||||||
|
|
||||||
return msg;
|
return BulletMoveStatus::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comprueba si el objeto está habilitado
|
bool Bullet::isEnabled() const {
|
||||||
bool Bullet::isEnabled()
|
return kind != BulletType::NULL_TYPE;
|
||||||
{
|
|
||||||
if (kind == BULLET_NULL)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deshabilita el objeto
|
void Bullet::disable() {
|
||||||
void Bullet::disable()
|
kind = BulletType::NULL_TYPE;
|
||||||
{
|
|
||||||
kind = BULLET_NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Obtiene el valor de la variable
|
int Bullet::getPosX() const {
|
||||||
int Bullet::getPosX()
|
|
||||||
{
|
|
||||||
return posX;
|
return posX;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Obtiene el valor de la variable
|
int Bullet::getPosY() const {
|
||||||
int Bullet::getPosY()
|
|
||||||
{
|
|
||||||
return posY;
|
return posY;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Establece el valor de la variable
|
void Bullet::setPosX(int x) {
|
||||||
void Bullet::setPosX(int x)
|
|
||||||
{
|
|
||||||
posX = x;
|
posX = x;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Establece el valor de la variable
|
void Bullet::setPosY(int y) {
|
||||||
void Bullet::setPosY(int y)
|
|
||||||
{
|
|
||||||
posY = y;
|
posY = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Obtiene el valor de la variable
|
int Bullet::getVelY() const {
|
||||||
int Bullet::getVelY()
|
|
||||||
{
|
|
||||||
return velY;
|
return velY;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Obtiene el valor de la variable
|
BulletType Bullet::getKind() const {
|
||||||
int Bullet::getKind()
|
|
||||||
{
|
|
||||||
return kind;
|
return kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Obtiene el valor de la variable
|
int Bullet::getOwner() const {
|
||||||
int Bullet::getOwner()
|
|
||||||
{
|
|
||||||
return owner;
|
return owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Obtiene el circulo de colisión
|
circle_t& Bullet::getCollider() {
|
||||||
circle_t &Bullet::getCollider()
|
|
||||||
{
|
|
||||||
return collider;
|
return collider;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Alinea el circulo de colisión con el objeto
|
void Bullet::shiftColliders() {
|
||||||
void Bullet::shiftColliders()
|
|
||||||
{
|
|
||||||
collider.x = posX + collider.r;
|
collider.x = posX + collider.r;
|
||||||
collider.y = posY + collider.r;
|
collider.y = posY + collider.r;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,81 +3,61 @@
|
|||||||
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
#include <SDL2/SDL_rect.h> // for SDL_Rect
|
||||||
#include <SDL2/SDL_stdinc.h> // for Uint8
|
#include <SDL2/SDL_stdinc.h> // for Uint8
|
||||||
#include "utils.h" // for circle_t
|
#include "utils.h" // for circle_t
|
||||||
|
#include <memory> // for std::unique_ptr
|
||||||
|
|
||||||
class Sprite;
|
class Sprite;
|
||||||
class Texture;
|
class Texture;
|
||||||
|
|
||||||
// Tipos de bala
|
// Enumeración para los diferentes tipos de balas
|
||||||
#define BULLET_UP 1
|
enum class BulletType
|
||||||
#define BULLET_LEFT 2
|
{
|
||||||
#define BULLET_RIGHT 3
|
UP,
|
||||||
#define BULLET_NULL 4
|
LEFT,
|
||||||
|
RIGHT,
|
||||||
|
NULL_TYPE
|
||||||
|
};
|
||||||
|
|
||||||
// Tipos de retorno de la funcion move de la bala
|
// Enumeración para los resultados del movimiento de la bala
|
||||||
#define BULLET_MOVE_OK 0
|
enum class BulletMoveStatus : Uint8
|
||||||
#define BULLET_MOVE_OUT 1
|
{
|
||||||
|
OK = 0,
|
||||||
|
OUT = 1
|
||||||
|
};
|
||||||
|
|
||||||
// Clase Bullet
|
// Clase Bullet
|
||||||
class Bullet
|
class Bullet
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
// Objetos y punteros
|
|
||||||
Sprite *sprite; // Sprite con los graficos y métodos de pintado
|
|
||||||
|
|
||||||
// Variables
|
|
||||||
int posX; // Posición en el eje X
|
int posX; // Posición en el eje X
|
||||||
int posY; // Posición en el eje Y
|
int posY; // Posición en el eje Y
|
||||||
Uint8 width; // Ancho del objeto
|
Uint8 width; // Ancho del objeto
|
||||||
Uint8 height; // Alto del objeto
|
Uint8 height; // Alto del objeto
|
||||||
int velX; // Velocidad en el eje X
|
int velX; // Velocidad en el eje X
|
||||||
int velY; // Velocidad en el eje Y
|
int velY; // Velocidad en el eje Y
|
||||||
int kind; // Tipo de objeto
|
BulletType kind; // Tipo de objeto
|
||||||
int owner; // Identificador del dueño del objeto
|
int owner; // Identificador del dueño del objeto
|
||||||
circle_t collider; // Circulo de colisión del objeto
|
circle_t collider; // Círculo de colisión del objeto
|
||||||
SDL_Rect *playArea; // Rectangulo con la zona de juego
|
SDL_Rect *playArea; // Rectángulo con la zona de juego
|
||||||
|
std::unique_ptr<Sprite> sprite; // Sprite con los gráficos y métodos de pintado
|
||||||
|
|
||||||
// Alinea el circulo de colisión con el objeto
|
void shiftColliders(); // Alinea el círculo de colisión con el objeto
|
||||||
void shiftColliders();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
Bullet(int x, int y, BulletType kind, bool poweredUp, int owner, SDL_Rect *playArea, Texture *texture);
|
||||||
Bullet(int x, int y, int kind, bool poweredUp, int owner, SDL_Rect *playArea, Texture *texture);
|
~Bullet() = default;
|
||||||
|
|
||||||
// Destructor
|
void render(); // Pinta el objeto en pantalla
|
||||||
~Bullet();
|
BulletMoveStatus move(); // Actualiza la posición y estado del objeto
|
||||||
|
|
||||||
// Pinta el objeto en pantalla
|
bool isEnabled() const; // Comprueba si el objeto está habilitado
|
||||||
void render();
|
void disable(); // Deshabilita el objeto
|
||||||
|
|
||||||
// Actualiza la posición y estado del objeto
|
int getPosX() const;
|
||||||
Uint8 move();
|
int getPosY() const;
|
||||||
|
|
||||||
// Comprueba si el objeto está habilitado
|
|
||||||
bool isEnabled();
|
|
||||||
|
|
||||||
// Deshabilita el objeto
|
|
||||||
void disable();
|
|
||||||
|
|
||||||
// Obtiene el valor de la variable
|
|
||||||
int getPosX();
|
|
||||||
|
|
||||||
// Obtiene el valor de la variable
|
|
||||||
int getPosY();
|
|
||||||
|
|
||||||
// Establece el valor de la variable
|
|
||||||
void setPosX(int x);
|
void setPosX(int x);
|
||||||
|
|
||||||
// Establece el valor de la variable
|
|
||||||
void setPosY(int y);
|
void setPosY(int y);
|
||||||
|
int getVelY() const;
|
||||||
// Obtiene el valor de la variable
|
BulletType getKind() const;
|
||||||
int getVelY();
|
int getOwner() const;
|
||||||
|
|
||||||
// Obtiene el valor de la variable
|
|
||||||
int getKind();
|
|
||||||
|
|
||||||
// Obtiene el valor de la variable
|
|
||||||
int getOwner();
|
|
||||||
|
|
||||||
// Obtiene el circulo de colisión
|
|
||||||
circle_t &getCollider();
|
circle_t &getCollider();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include "asset.h" // for Asset
|
#include "asset.h" // for Asset
|
||||||
#include "background.h" // for Background
|
#include "background.h" // for Background
|
||||||
#include "balloon.h" // for Balloon, BALLOON_SPEED_1, BALLOON_...
|
#include "balloon.h" // for Balloon, BALLOON_SPEED_1, BALLOON_...
|
||||||
#include "bullet.h" // for Bullet, BULLET_LEFT, BULLET_RIGHT
|
#include "bullet.h" // for Bullet, BulletType::LEFT, BulletType::RIGHT
|
||||||
#include "enemy_formations.h" // for stage_t, EnemyFormations, enemyIni...
|
#include "enemy_formations.h" // for stage_t, EnemyFormations, enemyIni...
|
||||||
#include "explosions.h" // for Explosions
|
#include "explosions.h" // for Explosions
|
||||||
#include "fade.h" // for Fade, FADE_RANDOM_SQUARE, FADE_VEN...
|
#include "fade.h" // for Fade, FADE_RANDOM_SQUARE, FADE_VEN...
|
||||||
@@ -1476,7 +1476,7 @@ void Game::moveBullets()
|
|||||||
{
|
{
|
||||||
if (bullet->isEnabled())
|
if (bullet->isEnabled())
|
||||||
{
|
{
|
||||||
if (bullet->move() == BULLET_MOVE_OUT)
|
if (bullet->move() == BulletMoveStatus::OUT)
|
||||||
{
|
{
|
||||||
Player *player = getPlayer(bullet->getOwner());
|
Player *player = getPlayer(bullet->getOwner());
|
||||||
player->decScoreMultiplier();
|
player->decScoreMultiplier();
|
||||||
@@ -1498,7 +1498,7 @@ void Game::renderBullets()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Crea un objeto bala
|
// Crea un objeto bala
|
||||||
void Game::createBullet(int x, int y, int kind, bool poweredUp, int owner)
|
void Game::createBullet(int x, int y, BulletType kind, bool poweredUp, int owner)
|
||||||
{
|
{
|
||||||
Bullet *b = new Bullet(x, y, kind, poweredUp, owner, &(param.game.playArea.rect), bulletTexture);
|
Bullet *b = new Bullet(x, y, kind, poweredUp, owner, &(param.game.playArea.rect), bulletTexture);
|
||||||
bullets.push_back(b);
|
bullets.push_back(b);
|
||||||
@@ -2096,7 +2096,7 @@ void Game::checkInput()
|
|||||||
if (player->canFire())
|
if (player->canFire())
|
||||||
{
|
{
|
||||||
player->setInput(input_fire_center);
|
player->setInput(input_fire_center);
|
||||||
createBullet(player->getPosX() + (player->getWidth() / 2) - 4, player->getPosY() + (player->getHeight() / 2), BULLET_UP, player->isPowerUp(), player->getId());
|
createBullet(player->getPosX() + (player->getWidth() / 2) - 4, player->getPosY() + (player->getHeight() / 2), BulletType::UP, player->isPowerUp(), player->getId());
|
||||||
player->setFireCooldown(10);
|
player->setFireCooldown(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2106,7 +2106,7 @@ void Game::checkInput()
|
|||||||
if (player->canFire())
|
if (player->canFire())
|
||||||
{
|
{
|
||||||
player->setInput(input_fire_left);
|
player->setInput(input_fire_left);
|
||||||
createBullet(player->getPosX() + (player->getWidth() / 2) - 4, player->getPosY() + (player->getHeight() / 2), BULLET_LEFT, player->isPowerUp(), player->getId());
|
createBullet(player->getPosX() + (player->getWidth() / 2) - 4, player->getPosY() + (player->getHeight() / 2), BulletType::LEFT, player->isPowerUp(), player->getId());
|
||||||
player->setFireCooldown(10);
|
player->setFireCooldown(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2116,7 +2116,7 @@ void Game::checkInput()
|
|||||||
if (player->canFire())
|
if (player->canFire())
|
||||||
{
|
{
|
||||||
player->setInput(input_fire_right);
|
player->setInput(input_fire_right);
|
||||||
createBullet(player->getPosX() + (player->getWidth() / 2) - 4, player->getPosY() + (player->getHeight() / 2), BULLET_RIGHT, player->isPowerUp(), player->getId());
|
createBullet(player->getPosX() + (player->getWidth() / 2) - 4, player->getPosY() + (player->getHeight() / 2), BulletType::RIGHT, player->isPowerUp(), player->getId());
|
||||||
player->setFireCooldown(10);
|
player->setFireCooldown(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2183,7 +2183,7 @@ void Game::checkInput()
|
|||||||
if (player->canFire())
|
if (player->canFire())
|
||||||
{
|
{
|
||||||
player->setInput(input_fire_center);
|
player->setInput(input_fire_center);
|
||||||
createBullet(player->getPosX() + (player->getWidth() / 2) - 4, player->getPosY() + (player->getHeight() / 2), BULLET_UP, player->isPowerUp(), player->getId());
|
createBullet(player->getPosX() + (player->getWidth() / 2) - 4, player->getPosY() + (player->getHeight() / 2), BulletType::UP, player->isPowerUp(), player->getId());
|
||||||
player->setFireCooldown(10);
|
player->setFireCooldown(10);
|
||||||
|
|
||||||
// Reproduce el sonido de disparo
|
// Reproduce el sonido de disparo
|
||||||
@@ -2200,7 +2200,7 @@ void Game::checkInput()
|
|||||||
if (player->canFire())
|
if (player->canFire())
|
||||||
{
|
{
|
||||||
player->setInput(input_fire_left);
|
player->setInput(input_fire_left);
|
||||||
createBullet(player->getPosX() + (player->getWidth() / 2) - 4, player->getPosY() + (player->getHeight() / 2), BULLET_LEFT, player->isPowerUp(), player->getId());
|
createBullet(player->getPosX() + (player->getWidth() / 2) - 4, player->getPosY() + (player->getHeight() / 2), BulletType::LEFT, player->isPowerUp(), player->getId());
|
||||||
player->setFireCooldown(10);
|
player->setFireCooldown(10);
|
||||||
|
|
||||||
// Reproduce el sonido de disparo
|
// Reproduce el sonido de disparo
|
||||||
@@ -2217,7 +2217,7 @@ void Game::checkInput()
|
|||||||
if (player->canFire())
|
if (player->canFire())
|
||||||
{
|
{
|
||||||
player->setInput(input_fire_right);
|
player->setInput(input_fire_right);
|
||||||
createBullet(player->getPosX() + (player->getWidth() / 2) - 4, player->getPosY() + (player->getHeight() / 2), BULLET_RIGHT, player->isPowerUp(), player->getId());
|
createBullet(player->getPosX() + (player->getWidth() / 2) - 4, player->getPosY() + (player->getHeight() / 2), BulletType::RIGHT, player->isPowerUp(), player->getId());
|
||||||
player->setFireCooldown(10);
|
player->setFireCooldown(10);
|
||||||
|
|
||||||
// Reproduce el sonido de disparo
|
// Reproduce el sonido de disparo
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
#include "section.h" // for options_e
|
#include "section.h" // for options_e
|
||||||
#include "utils.h" // for demoKeys_t, color_t, hiScoreEntry_t
|
#include "utils.h" // for demoKeys_t, color_t, hiScoreEntry_t
|
||||||
|
#include "bullet.h"
|
||||||
class Asset;
|
class Asset;
|
||||||
class Background;
|
class Background;
|
||||||
class Balloon;
|
class Balloon;
|
||||||
@@ -312,7 +313,7 @@ private:
|
|||||||
void renderBullets();
|
void renderBullets();
|
||||||
|
|
||||||
// Crea un objeto bala
|
// Crea un objeto bala
|
||||||
void createBullet(int x, int y, int kind, bool poweredUp, int owner);
|
void createBullet(int x, int y, BulletType kind, bool poweredUp, int owner);
|
||||||
|
|
||||||
// Vacia el vector de balas
|
// Vacia el vector de balas
|
||||||
void freeBullets();
|
void freeBullets();
|
||||||
|
|||||||
Reference in New Issue
Block a user