working on 2p
This commit is contained in:
@@ -17,7 +17,7 @@ Bullet::~Bullet()
|
||||
}
|
||||
|
||||
// Iniciador
|
||||
void Bullet::init(int x, int y, int kind, bool poweredUp, LTexture *texture, SDL_Renderer *renderer)
|
||||
void Bullet::init(int x, int y, int kind, bool poweredUp, int owner, LTexture *texture, SDL_Renderer *renderer)
|
||||
{
|
||||
// Posición inicial del objeto
|
||||
mPosX = x;
|
||||
@@ -33,6 +33,9 @@ void Bullet::init(int x, int y, int kind, bool poweredUp, LTexture *texture, SDL
|
||||
// Tipo de bala
|
||||
mKind = kind;
|
||||
|
||||
// Identificador del dueño del objeto
|
||||
mOwner = -1;
|
||||
|
||||
// Textura con los gráficos del objeto
|
||||
mSprite->setTexture(texture);
|
||||
|
||||
@@ -157,7 +160,7 @@ void Bullet::testMove()
|
||||
// Deshabilita el objeto
|
||||
void Bullet::erase()
|
||||
{
|
||||
init(0, 0, 0, false, nullptr, nullptr);
|
||||
init(0, 0, 0, false, -1, nullptr, nullptr);
|
||||
}
|
||||
|
||||
// Comprueba si el objeto está activo
|
||||
@@ -209,6 +212,12 @@ int Bullet::getKind()
|
||||
return mKind;
|
||||
}
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
int Bullet::getOwner()
|
||||
{
|
||||
return mOwner;
|
||||
}
|
||||
|
||||
// Obtiene el circulo de colisión
|
||||
circle_t &Bullet::getCollider()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user