Compare commits

..

3 Commits

7 changed files with 38 additions and 27 deletions

View File

@@ -1,43 +1,41 @@
## GAME ## GAME
gameWidth 320 gameWidth 320
gameHeight 240 gameHeight 240
itemSize 20 itemSize 20
autofire true
## FADE ## FADE
numSquaresWidth 160 numSquaresWidth 160
numSquaresHeight 120 numSquaresHeight 120
fadeRandomSquaresDelay 1 fadeRandomSquaresDelay 1
fadeRandomSquaresMult 500 fadeRandomSquaresMult 500
fadePostDuration 80 fadePostDuration 80
venetianSize 16 venetianSize 16
## SCOREBOARD ## SCOREBOARD
scoreboard.x 0 scoreboard.x 0
scoreboard.y 200 scoreboard.y 200
scoreboard.w 320 scoreboard.w 320
scoreboard.h 40 scoreboard.h 40
## TITLE ## TITLE
pressStart 170 pressStart 170
titleCounter 800 titleCounter 800
arcadeEdition 123 arcadeEdition 123
titleCC 80 titleCC 80
## BACKGROUND ## BACKGROUND
backgroundAttenuateColor.r 255 backgroundAttenuateColor.r 255
backgroundAttenuateColor.g 255 backgroundAttenuateColor.g 255
backgroundAttenuateColor.b 255 backgroundAttenuateColor.b 255
backgroundAttenuateColor.a 0 backgroundAttenuateColor.a 0
## BALLOONS ## BALLOONS
balloon1.vel 2.6f balloon1.vel 2.70f
balloon1.grav 0.09f balloon1.grav 0.09f
balloon2.vel 3.70f
balloon2.vel 3.5f
balloon2.grav 0.10f balloon2.grav 0.10f
balloon3.vel 4.70f
balloon3.vel 4.50f
balloon3.grav 0.10f balloon3.grav 0.10f
balloon4.vel 5.45f
balloon4.vel 4.95f
balloon4.grav 0.10f balloon4.grav 0.10f

Binary file not shown.

Before

Width:  |  Height:  |  Size: 644 B

After

Width:  |  Height:  |  Size: 858 B

View File

@@ -4,16 +4,18 @@
// Constructor // Constructor
Bullet::Bullet(int x, int y, int kind, bool poweredUp, int owner, Texture *texture) Bullet::Bullet(int x, int y, int kind, bool poweredUp, int owner, Texture *texture)
{ {
sprite = new Sprite({x, y, 10, 10}, texture);
// Posición inicial del objeto // Posición inicial del objeto
posX = x; posX = x;
posY = y; posY = y;
// Alto y ancho del objeto // Alto y ancho del objeto
width = 10; width = 12;
height = 10; height = 12;
// Crea el sprite
sprite = new Sprite({x, y, width, height}, texture);
// Velocidad inicial en el eje Y // Velocidad inicial en el eje Y
velY = -3; velY = -3;

View File

@@ -148,6 +148,7 @@ struct op_game_t
{ {
Uint8 difficulty; // Dificultad del juego Uint8 difficulty; // Dificultad del juego
Uint8 language; // Idioma usado en el juego Uint8 language; // Idioma usado en el juego
bool autofire; // Indica si se va a usar el disparo automático para el disparo normal
std::vector<hiScoreEntry_t> hiScoreTable; // Tabla con las mejores puntuaciones std::vector<hiScoreEntry_t> hiScoreTable; // Tabla con las mejores puntuaciones
}; };
@@ -194,7 +195,8 @@ struct param_t
// GAME // GAME
int gameWidth; // Ancho de la resolucion nativa del juego int gameWidth; // Ancho de la resolucion nativa del juego
int gameHeight; // Alto de la resolucion nativa del juego int gameHeight; // Alto de la resolucion nativa del juego
int itemSize; // Tamañoi de los items del juego int itemSize; // Tamaño de los items del juego
int autofire; // Indica si se va a usar el disparo automático para el disparo normal
// FADE // FADE
int numSquaresWidth; // Cantidad total de cuadraditos en horizontal para el FADE_RANDOM_SQUARE int numSquaresWidth; // Cantidad total de cuadraditos en horizontal para el FADE_RANDOM_SQUARE

View File

@@ -424,6 +424,8 @@ void Director::loadParams()
loadParam(param, asset->get("param.txt")); loadParam(param, asset->get("param.txt"));
// Modifica las opciones desde el fichero de parametros
options->game.autofire = param->autofire;
options->video.window.width = options->video.window.size * param->gameWidth; options->video.window.width = options->video.window.size * param->gameWidth;
options->video.window.height = options->video.window.size * param->gameHeight; options->video.window.height = options->video.window.size * param->gameHeight;
options->video.gameWidth = param->gameWidth; options->video.gameWidth = param->gameWidth;

View File

@@ -2235,6 +2235,7 @@ void Game::checkInput()
int i = 0; int i = 0;
for (auto player : players) for (auto player : players)
{ {
const bool autofire = player->isPowerUp() || options->game.autofire;
if (player->isAlive() && player->isEnabled()) if (player->isAlive() && player->isEnabled())
{ {
// Input a la izquierda // Input a la izquierda
@@ -2265,7 +2266,7 @@ void Game::checkInput()
} }
} }
// Comprueba el input de disparar al centro // Comprueba el input de disparar al centro
if (input->checkInput(input_fire_center, ALLOW_REPEAT, options->controller[i].deviceType, options->controller[i].index)) if (input->checkInput(input_fire_center, autofire, options->controller[i].deviceType, options->controller[i].index))
{ {
if (player->canFire()) if (player->canFire())
{ {
@@ -2282,7 +2283,7 @@ void Game::checkInput()
} }
// Comprueba el input de disparar a la izquierda // Comprueba el input de disparar a la izquierda
else if (input->checkInput(input_fire_left, ALLOW_REPEAT, options->controller[i].deviceType, options->controller[i].index)) else if (input->checkInput(input_fire_left, autofire, options->controller[i].deviceType, options->controller[i].index))
{ {
if (player->canFire()) if (player->canFire())
{ {
@@ -2299,7 +2300,7 @@ void Game::checkInput()
} }
// Comprueba el input de disparar a la derecha // Comprueba el input de disparar a la derecha
else if (input->checkInput(input_fire_right, ALLOW_REPEAT, options->controller[i].deviceType, options->controller[i].index)) else if (input->checkInput(input_fire_right, autofire, options->controller[i].deviceType, options->controller[i].index))
{ {
if (player->canFire()) if (player->canFire())
{ {

View File

@@ -12,6 +12,7 @@ void initParam(param_t *param)
param->gameWidth = 320; param->gameWidth = 320;
param->gameHeight = 240; param->gameHeight = 240;
param->itemSize = 20; param->itemSize = 20;
param->autofire = true;
// SCOREBOARD // SCOREBOARD
param->scoreboard = {0, 200, 320, 40}; param->scoreboard = {0, 200, 320, 40};
@@ -154,6 +155,11 @@ bool setOptions(param_t *param, std::string var, std::string value)
param->itemSize = std::stoi(value); param->itemSize = std::stoi(value);
} }
else if (var == "autofire")
{
param->autofire = stringToBool(value);
}
// FADE // FADE
else if (var == "numSquaresWidth") else if (var == "numSquaresWidth")
{ {