Resueltos los dos últimos problemas

This commit is contained in:
2022-10-03 17:14:33 +02:00
parent 99b61c4b2d
commit 95d6396dfa
7 changed files with 204 additions and 129 deletions

View File

@@ -45,7 +45,7 @@ MovingSprite::MovingSprite(float x, float y, int w, int h, float velx, float vel
spriteClip = {0, 0, w, h};
// Establece el centro de rotación
center = {0, 0};
center = nullptr;
// Establece el tipo de volteado
currentFlip = SDL_FLIP_NONE;
@@ -73,7 +73,7 @@ void MovingSprite::clear()
angle = 0.0; // Angulo para dibujarlo
rotateEnabled = false; // Indica si ha de rotar
center = {0, 0}; // Centro de rotación
center = nullptr; // Centro de rotación
rotateSpeed = 0; // Velocidad de giro
rotateAmount = 0.0; // Cantidad de grados a girar en cada iteración
counter = 0; // Contador interno
@@ -101,7 +101,9 @@ void MovingSprite::move()
void MovingSprite::render()
{
if (enabled)
texture->render(renderer, (int)x, (int)y, &spriteClip, zoomW, zoomH, angle, &center, currentFlip);
{
texture->render(renderer, (int)x, (int)y, &spriteClip, zoomW, zoomH, angle, center, currentFlip);
}
}
// Obtiene el valor de la variable