afegits els grafics nous per al jugador
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 835 B After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 529 B After Width: | Height: | Size: 1.0 KiB |
@@ -1,5 +1,5 @@
|
||||
frameWidth=24
|
||||
frameHeight=24
|
||||
frameWidth=30
|
||||
frameHeight=30
|
||||
|
||||
[animation]
|
||||
name=walk
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
frameWidth=24
|
||||
frameHeight=24
|
||||
frameWidth=30
|
||||
frameHeight=30
|
||||
|
||||
[animation]
|
||||
name=default
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
frameWidth=28
|
||||
frameHeight=32
|
||||
frameWidth=35
|
||||
frameHeight=40
|
||||
|
||||
[animation]
|
||||
name=default
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
frameWidth=24
|
||||
frameHeight=24
|
||||
frameWidth=30
|
||||
frameHeight=30
|
||||
|
||||
[animation]
|
||||
name=walk
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
frameWidth=24
|
||||
frameHeight=24
|
||||
frameWidth=30
|
||||
frameHeight=30
|
||||
|
||||
[animation]
|
||||
name=walk
|
||||
|
||||
@@ -179,10 +179,10 @@ void Game::init(int playerID)
|
||||
players.clear();
|
||||
|
||||
// Crea los dos jugadores
|
||||
Player *player1 = new Player((PLAY_AREA_CENTER_FIRST_QUARTER_X * ((0 * 2) + 1)) - 11, PLAY_AREA_BOTTOM - 24, renderer, playerTextures[0], playerAnimations);
|
||||
Player *player1 = new Player((PLAY_AREA_CENTER_FIRST_QUARTER_X * ((0 * 2) + 1)) - 11, PLAY_AREA_BOTTOM - 30, renderer, playerTextures[0], playerAnimations);
|
||||
players.push_back(player1);
|
||||
|
||||
Player *player2 = new Player((PLAY_AREA_CENTER_FIRST_QUARTER_X * ((1 * 2) + 1)) - 11, PLAY_AREA_BOTTOM - 24, renderer, playerTextures[1], playerAnimations);
|
||||
Player *player2 = new Player((PLAY_AREA_CENTER_FIRST_QUARTER_X * ((1 * 2) + 1)) - 11, PLAY_AREA_BOTTOM - 30, renderer, playerTextures[1], playerAnimations);
|
||||
players.push_back(player2);
|
||||
|
||||
// Habilita el jugador seleccionado. playerID es player 1 o player 2
|
||||
|
||||
@@ -240,7 +240,6 @@ private:
|
||||
// Guarda el fichero de datos para la demo
|
||||
bool saveDemoFile();
|
||||
#endif
|
||||
|
||||
// Inicializa las formaciones enemigas
|
||||
void initEnemyFormations();
|
||||
|
||||
|
||||
@@ -52,11 +52,11 @@ void Player::init()
|
||||
input = true;
|
||||
|
||||
// Establece la altura y el ancho del jugador
|
||||
width = 24;
|
||||
height = 24;
|
||||
width = 30;
|
||||
height = 30;
|
||||
|
||||
// Establece el tamaño del circulo de colisión
|
||||
collider.r = 7;
|
||||
collider.r = 9;
|
||||
|
||||
// Actualiza la posición del circulo de colisión
|
||||
shiftColliders();
|
||||
@@ -153,7 +153,7 @@ void Player::move()
|
||||
headSprite->setPosY(posY);
|
||||
|
||||
fireSprite->setPosX(getPosX() - 2);
|
||||
fireSprite->setPosY(posY - 8);
|
||||
fireSprite->setPosY(posY - 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -179,7 +179,7 @@ void Player::render()
|
||||
{
|
||||
if (invulnerable)
|
||||
{
|
||||
if ((invulnerableCounter % 10) > 4)
|
||||
if ((invulnerableCounter % 6) > 2)
|
||||
{
|
||||
if (powerUp)
|
||||
{
|
||||
@@ -528,10 +528,12 @@ void Player::removeExtraHit()
|
||||
{
|
||||
coffees--;
|
||||
}
|
||||
|
||||
if (coffees == 0)
|
||||
{
|
||||
extraHit = false;
|
||||
}
|
||||
|
||||
invulnerable = true;
|
||||
invulnerableCounter = PLAYER_INVULNERABLE_COUNTER;
|
||||
}
|
||||
@@ -576,27 +578,18 @@ Texture *Player::getDeadTexture()
|
||||
// Actualiza el valor de la variable
|
||||
void Player::updatePowerUpHeadOffset()
|
||||
{
|
||||
if (!powerUp)
|
||||
{
|
||||
// powerUpHeadOffset = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// powerUpHeadOffset = 96;
|
||||
if (powerUp)
|
||||
if (powerUpCounter < 300)
|
||||
{
|
||||
if (powerUpCounter % 10 > 4)
|
||||
if (powerUpCounter % 6 > 2)
|
||||
{
|
||||
// powerUpHeadOffset = 96;
|
||||
fireSprite->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// powerUpHeadOffset = 0;
|
||||
fireSprite->setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Pone las texturas del jugador
|
||||
|
||||