El jugador ya cambia de pantalla

This commit is contained in:
2022-07-05 20:44:35 +02:00
parent a8896841a3
commit 4243f89dc0
11 changed files with 221 additions and 44 deletions

View File

@@ -30,9 +30,12 @@ void MovingSprite::clear()
mAngle = 0.0; // Angulo para dibujarlo
mRotate = false; // Indica si ha de rotar
mCenter = {0, 0}; // Centro de rotación
mRotateSpeed = 0; // Velocidad de giro
mRotateAmount = 0.0; // Cantidad de grados a girar en cada iteración
mCounter = 0; // Contador interno
mFlip = SDL_FLIP_NONE; // Establece como se ha de voltear el sprite
}
// Iniciador
@@ -96,7 +99,7 @@ void MovingSprite::move()
void MovingSprite::render()
{
if (mEnabled)
mTexture->render(mRenderer, (int)mPosX, (int)mPosY, &mSpriteClip, mZoomW, mZoomH, mAngle);
mTexture->render(mRenderer, (int)mPosX, (int)mPosY, &mSpriteClip, mZoomW, mZoomH, mAngle, &mCenter, mFlip);
}
// Obtiene el valor de la variable
@@ -283,4 +286,10 @@ void MovingSprite::update()
void MovingSprite::switchRotate()
{
mRotateAmount *= -1;
}
// Establece el valor de la variable
void MovingSprite::setFlip(SDL_RendererFlip flip)
{
mFlip = flip;
}