working on 2p
This commit is contained in:
@@ -23,8 +23,11 @@ Player::~Player()
|
||||
}
|
||||
|
||||
// Iniciador
|
||||
void Player::init(float x, int y, LTexture *textureLegs, LTexture *textureBody, LTexture *textureHead, SDL_Renderer *renderer)
|
||||
void Player::init(float x, int y, LTexture *textureLegs, LTexture *textureBody, LTexture *textureHead, LTexture *textureDead, SDL_Renderer *renderer)
|
||||
{
|
||||
// Copia punteros
|
||||
mPlayerDeadTexture = textureDead;
|
||||
|
||||
// Inicializa variables de estado
|
||||
mAlive = true;
|
||||
mStatusWalking = PLAYER_STATUS_WALKING_STOP;
|
||||
@@ -545,19 +548,19 @@ void Player::update()
|
||||
}
|
||||
|
||||
// Obtiene la puntuación del jugador
|
||||
int Player::getScore()
|
||||
Uint32 Player::getScore()
|
||||
{
|
||||
return mScore;
|
||||
}
|
||||
|
||||
// Asigna un valor a la puntuación del jugador
|
||||
void Player::setScore(int score)
|
||||
void Player::setScore(Uint32 score)
|
||||
{
|
||||
mScore = score;
|
||||
}
|
||||
|
||||
// Incrementa la puntuación del jugador
|
||||
void Player::addScore(int score)
|
||||
void Player::addScore(Uint32 score)
|
||||
{
|
||||
mScore += score;
|
||||
}
|
||||
@@ -735,4 +738,10 @@ void Player::shiftColliders()
|
||||
{
|
||||
mCollider.x = Uint16(mPosX + (mWidth / 2));
|
||||
mCollider.y = mPosY + (mHeight / 2);
|
||||
}
|
||||
|
||||
// Obtiene el puntero a la textura con los gráficos de la animación de morir
|
||||
LTexture *Player::getDeadTexture()
|
||||
{
|
||||
return mPlayerDeadTexture;
|
||||
}
|
||||
Reference in New Issue
Block a user