Compare commits
5 Commits
ebfa2433de
...
cd70336051
| Author | SHA1 | Date | |
|---|---|---|---|
| cd70336051 | |||
| fa649207bd | |||
| 2764ff2e93 | |||
| ad170e8e0e | |||
| c58f2213d5 |
4
Makefile
4
Makefile
@@ -172,6 +172,10 @@ macos:
|
|||||||
$(CXX) $(SOURCES) $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)"
|
$(CXX) $(SOURCES) $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)"
|
||||||
|
|
||||||
|
|
||||||
|
macos_fast:
|
||||||
|
$(CXX) $(SOURCES) -D VERBOSE -std=c++11 -Wall -Wno-deprecated -lSDL2 -framework OpenGL -o "$(TARGET_FILE)"
|
||||||
|
|
||||||
|
|
||||||
macos_debug:
|
macos_debug:
|
||||||
$(CXX) $(SOURCES) -D DEBUG $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)_debug"
|
$(CXX) $(SOURCES) -D DEBUG $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)_debug"
|
||||||
|
|
||||||
|
|||||||
@@ -245,6 +245,7 @@ void Game::init(int playerID)
|
|||||||
|
|
||||||
if (demo.enabled)
|
if (demo.enabled)
|
||||||
{
|
{
|
||||||
|
// Selecciona una pantalla al azar
|
||||||
const int num = rand() % 2;
|
const int num = rand() % 2;
|
||||||
if (num == 0)
|
if (num == 0)
|
||||||
{
|
{
|
||||||
@@ -256,6 +257,15 @@ void Game::init(int playerID)
|
|||||||
balloonsPopped = 1800;
|
balloonsPopped = 1800;
|
||||||
currentStage = 6;
|
currentStage = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Añade 0, 1 o 2 cafes al jugador
|
||||||
|
// for (int i = 0; i < rand() % 4; ++i)
|
||||||
|
{
|
||||||
|
players[0]->hasExtraHit();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deshabilita los sonidos
|
||||||
|
JA_EnableSound(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
initPaths();
|
initPaths();
|
||||||
@@ -277,9 +287,10 @@ void Game::init(int playerID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Modo demo
|
// Modo demo
|
||||||
demo.recording = false;
|
|
||||||
#ifdef RECORDING
|
#ifdef RECORDING
|
||||||
demo.recording = true;
|
demo.recording = true;
|
||||||
|
#else
|
||||||
|
demo.recording = false;
|
||||||
#endif
|
#endif
|
||||||
demo.counter = 0;
|
demo.counter = 0;
|
||||||
|
|
||||||
@@ -1539,7 +1550,7 @@ void Game::updatePlayers()
|
|||||||
{
|
{
|
||||||
killPlayer(player);
|
killPlayer(player);
|
||||||
|
|
||||||
if (demo.enabled)
|
if (demo.enabled && !player->isAlive())
|
||||||
{
|
{
|
||||||
section->name = SECTION_PROG_HI_SCORE_TABLE;
|
section->name = SECTION_PROG_HI_SCORE_TABLE;
|
||||||
}
|
}
|
||||||
@@ -2118,18 +2129,16 @@ void Game::checkBulletBalloonCollision()
|
|||||||
// Explota el globo
|
// Explota el globo
|
||||||
popBalloon(balloon);
|
popBalloon(balloon);
|
||||||
|
|
||||||
// Si no es el modo demo, genera un sonido
|
// Sonido de explosión
|
||||||
if (!demo.enabled)
|
JA_PlaySound(balloonSound);
|
||||||
{
|
|
||||||
JA_PlaySound(balloonSound);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deshabilita la bala
|
// Deshabilita la bala
|
||||||
bullet->disable();
|
bullet->disable();
|
||||||
|
|
||||||
// Suelta el item en caso de que salga uno
|
// Suelta el item en caso de que salga uno
|
||||||
const Uint8 droppeditem = dropItem();
|
const Uint8 droppeditem = dropItem();
|
||||||
if ((droppeditem != NO_KIND) && !(demo.enabled) && !(demo.recording))
|
// if ((droppeditem != NO_KIND) && !(demo.enabled) && !(demo.recording))
|
||||||
|
if ((droppeditem != NO_KIND) && !(demo.recording))
|
||||||
{
|
{
|
||||||
if (droppeditem != ITEM_COFFEE_MACHINE)
|
if (droppeditem != ITEM_COFFEE_MACHINE)
|
||||||
{
|
{
|
||||||
@@ -2768,7 +2777,7 @@ void Game::checkInput()
|
|||||||
if (players[index]->canFire())
|
if (players[index]->canFire())
|
||||||
{
|
{
|
||||||
players[index]->setInput(input_fire_left);
|
players[index]->setInput(input_fire_left);
|
||||||
createBullet(players[index]->getPosX() + (players[index]->getWidth() / 2) - 4, players[index]->getPosY() + (players[index]->getHeight() / 2), BULLET_UP, players[index]->isPowerUp(), index);
|
createBullet(players[index]->getPosX() + (players[index]->getWidth() / 2) - 4, players[index]->getPosY() + (players[index]->getHeight() / 2), BULLET_LEFT, players[index]->isPowerUp(), index);
|
||||||
players[index]->setFireCooldown(10);
|
players[index]->setFireCooldown(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2778,7 +2787,7 @@ void Game::checkInput()
|
|||||||
if (players[index]->canFire())
|
if (players[index]->canFire())
|
||||||
{
|
{
|
||||||
players[index]->setInput(input_fire_right);
|
players[index]->setInput(input_fire_right);
|
||||||
createBullet(players[index]->getPosX() + (players[index]->getWidth() / 2) - 4, players[index]->getPosY() + (players[index]->getHeight() / 2), BULLET_UP, players[index]->isPowerUp(), index);
|
createBullet(players[index]->getPosX() + (players[index]->getWidth() / 2) - 4, players[index]->getPosY() + (players[index]->getHeight() / 2), BULLET_RIGHT, players[index]->isPowerUp(), index);
|
||||||
players[index]->setFireCooldown(10);
|
players[index]->setFireCooldown(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3033,6 +3042,12 @@ void Game::run()
|
|||||||
checkEvents(); // Tiene que ir antes del render
|
checkEvents(); // Tiene que ir antes del render
|
||||||
render();
|
render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Vuelve a dejar el sonido como estaba
|
||||||
|
if (demo.enabled)
|
||||||
|
{
|
||||||
|
JA_EnableSound(options->audio.sound.enabled);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Indica si se puede crear una powerball
|
// Indica si se puede crear una powerball
|
||||||
|
|||||||
@@ -511,10 +511,9 @@ bool Player::hasExtraHit()
|
|||||||
void Player::giveExtraHit()
|
void Player::giveExtraHit()
|
||||||
{
|
{
|
||||||
extraHit = true;
|
extraHit = true;
|
||||||
coffees++;
|
if (coffees < 2)
|
||||||
if (coffees > 2)
|
|
||||||
{
|
{
|
||||||
coffees = 2;
|
coffees++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1
todo.txt
1
todo.txt
@@ -13,3 +13,4 @@
|
|||||||
[] Estandarizar tipografias, dejar solo una (o dos)
|
[] Estandarizar tipografias, dejar solo una (o dos)
|
||||||
[] Crear objeto encargado de los mensajes en pantalla (en vez de ser la clase game)
|
[] Crear objeto encargado de los mensajes en pantalla (en vez de ser la clase game)
|
||||||
[] ABSOLUTAMENTE TODO ha de estar en un fichero de texto y en una variable PARAMETROS: fisicas, tamaños de zona de juego, formaciones enemigas...
|
[] ABSOLUTAMENTE TODO ha de estar en un fichero de texto y en una variable PARAMETROS: fisicas, tamaños de zona de juego, formaciones enemigas...
|
||||||
|
[] Añadir notificaciones para el cambio de tamaño de ventana, shaders, filtro, mute, etc...
|
||||||
Reference in New Issue
Block a user