Añadido el parametro --invincible

This commit is contained in:
2022-11-02 16:34:31 +01:00
parent 88f419e963
commit c3a82b938f
9 changed files with 47 additions and 40 deletions

View File

@@ -3,21 +3,21 @@
<tileset firstgid="1" source="standard.tsx"/>
<layer id="1" name="Capa de patrones 1" width="32" height="16">
<data encoding="csv">
28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,
28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,
28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,
28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,
28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,
28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,
28,0,0,0,0,0,0,0,0,0,0,267,267,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,
28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,52,52,0,0,0,0,0,0,0,0,0,0,28,
28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,426,427,426,427,
28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,426,427,93,
28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,117,
28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,117,
28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,117,
28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,117,
28,0,0,0,0,0,0,0,0,0,0,267,267,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,141,
28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,52,52,0,0,0,0,0,0,0,0,0,0,32,
28,28,28,28,28,28,0,0,0,267,267,0,0,0,0,0,0,0,0,28,0,0,0,0,267,267,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,267,267,0,0,0,0,0,0,0,0,0,28,0,0,0,0,267,267,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,28,28,28,
0,0,0,0,0,0,0,267,267,267,267,267,267,0,0,0,0,0,0,28,0,0,0,0,267,267,0,0,0,0,0,28,
0,0,0,0,0,267,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,28,
28,28,532,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,52,52,52,52,52,52,52,52,52,52,52,28,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,28,28,32,
0,0,0,0,0,0,0,267,267,267,267,267,267,0,0,0,0,0,0,28,0,0,0,0,267,267,0,0,0,0,0,32,
0,0,0,0,0,267,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,89,
28,28,532,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,52,52,52,52,52,52,52,52,89,90,89,90,
28,28,28,28,28,28,28,28,28,28,28,28,28,28,267,0,0,267,28,28,28,28,28,28,28,28,28,28,28,28,28,28
</data>
</layer>

View File

@@ -1,6 +1,6 @@
name=QUO VOIDIS
bgColor=bright_black
border=black
bgColor=blue
border=bright_black
tileMapFile=29.tmx
tileSetFile=standard.png
roomUp=27.room
@@ -18,7 +18,7 @@ height=16
x=7
y=1
vx=0
vy=0.7
vy=0.8
x1=7
y1=1
x2=7
@@ -34,7 +34,7 @@ height=16
x=12
y=6
vx=0
vy=0.7
vy=0.6
x1=12
y1=1
x2=12
@@ -50,12 +50,12 @@ height=16
x=17
y=8
vx=0
vy=0.7
vy=0.9
x1=17
y1=1
x2=17
y2=13
color=red
color=green
[/enemy]
[enemy]
@@ -71,7 +71,7 @@ x1=22
y1=1
x2=22
y2=13
color=yellow
color=magenta
[/enemy]
[item]

View File

@@ -3,7 +3,7 @@
<tileset firstgid="1" source="standard.tsx"/>
<layer id="1" name="Capa de patrones 1" width="32" height="16">
<data encoding="csv">
133,133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,505,133,
133,133,133,133,133,133,133,131,131,133,133,133,132,132,133,133,133,132,132,133,133,133,131,131,133,133,0,0,0,0,505,133,
133,133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,505,0,133,
133,133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,505,0,0,133,
133,133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,505,0,0,0,133,
@@ -18,7 +18,7 @@
133,133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,228,228,0,0,0,0,133,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,
133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133
133,133,133,133,133,133,133,131,131,133,133,133,132,132,133,133,133,132,132,133,133,133,131,131,133,133,133,133,133,133,133,133
</data>
</layer>
</map>

View File

@@ -1,6 +1,6 @@
name=no 30
bgColor=black
border=red
name=QVOID IS A JAILGAME!
bgColor=bright_black
border=bright_black
tileMapFile=30.tmx
tileSetFile=standard.png
roomUp=0

View File

@@ -3,22 +3,22 @@
<tileset firstgid="1" source="standard.tsx"/>
<layer id="1" name="Capa de patrones 1" width="32" height="16">
<data encoding="csv">
133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,
133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,0,0,0,0,0,0,0,0,0,0,0,0,133,
133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,
133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,
133,228,228,0,0,228,228,0,0,228,228,0,0,228,228,0,0,228,228,0,0,0,0,0,0,0,0,0,0,0,0,133,
133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,
133,0,0,228,228,0,0,228,228,0,0,228,228,0,0,228,228,0,0,0,228,228,0,0,0,228,228,548,0,0,0,133,
133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,548,0,0,133,
133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,228,0,133,
133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,
133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,
133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,
133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,
133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,
133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,
133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,
133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,
133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,
133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133
133,0,0,0,0,0,0,0,0,485,485,485,0,0,0,228,228,0,0,0,485,485,485,0,0,0,228,228,0,0,0,133,
133,0,0,0,228,228,228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,
133,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,228,133,
133,228,228,548,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,
133,0,0,0,548,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
133,0,0,0,0,548,0,0,0,0,0,555,0,0,0,0,0,0,0,0,0,555,0,0,0,0,0,0,0,0,0,0,
133,555,555,555,555,555,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,485,133,133,133
</data>
</layer>
</map>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@@ -77,6 +77,7 @@ struct options_t
palette_e palette; // Paleta de colores a usar en el juego
bool console; // Indica si ha de mostrar información por la consola de texto
bool infiniteLives; // Indica si el jugador dispone de vidas infinitas
bool invincible; // Indica si el jugador puede morir
};
// Calcula el cuadrado de la distancia entre dos puntos

View File

@@ -86,6 +86,7 @@ void Director::iniOptions()
// Estos valores no se guardan en el fichero de configuraci´ón
options->console = false;
options->infiniteLives = false;
options->invincible = false;
}
// Comprueba los parametros del programa
@@ -106,6 +107,11 @@ void Director::checkProgramArguments(int argc, char *argv[])
{
options->infiniteLives = true;
}
else if (strcmp(argv[i], "--invincible") == 0)
{
options->invincible = true;
}
}
}

View File

@@ -20,9 +20,9 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *as
// ****
// this->debug->setEnabled(true);
currentRoom = "46.room";
const int x = 0;
const int y = 6;
currentRoom = "27.room";
const int x = 29;
const int y = 13;
spawnPoint = {x * 8, y * 8, 0, 0, 0, s_standing, SDL_FLIP_HORIZONTAL};
// ****
@@ -384,7 +384,7 @@ void Game::checkEndGame()
// Mata al jugador
void Game::killPlayer()
{
if (this->player->getInvincible())
if (this->player->getInvincible() || options->invincible)
{
return;
}