working on "How to play"

This commit is contained in:
2021-04-05 17:56:15 +02:00
parent d84137daa7
commit 36bb6b8fe8
16 changed files with 648 additions and 392 deletions

View File

@@ -92,24 +92,6 @@ void SmartSprite::setDestY(int value)
mDestY = value;
}
// Establece el valor de la variable
void SmartSprite::setRotate(bool value)
{
mRotate = value;
}
// Establece el valor de la variable
void SmartSprite::setRotateSpeed(Uint16 value)
{
mRotateSpeed = value;
}
// Establece el valor de la variable
void SmartSprite::setRotateAmount(double value)
{
mRotateAmount = value;
}
// Obtiene el valor de la variable
int SmartSprite::getDestX()
{
@@ -122,37 +104,12 @@ int SmartSprite::getDestY()
return mDestY;
}
// Obtiene el valor de la variable
bool SmartSprite::getRotate()
{
return mRotate;
}
// Obtiene el valor de la variable
Uint16 SmartSprite::getRotateSpeed()
{
return mRotateSpeed;
}
// Establece la rotacion
void SmartSprite::rotate()
{
if (mRotate)
{
if (mCounter % mRotateSpeed == 0)
{
incAngle(mRotateAmount);
}
}
}
// Actualiza la posición y comprueba si ha llegado a su destino
bool SmartSprite::update()
{
if (mEnabled)
{
move();
rotate();
MovingSprite::update();
// Comprueba si se desplaza en el eje X hacia la derecha
if ((getAccelX() > 0) || ((getAccelX() == 0) && (getVelX() > 0)))
@@ -168,7 +125,6 @@ bool SmartSprite::update()
setAccelX(0.0f);
}
}
// Comprueba si se desplaza en el eje X hacia la izquierda
else if ((getAccelX() < 0) || ((getAccelX() == 0) && (getVelX() < 0)))
{
@@ -244,9 +200,6 @@ bool SmartSprite::update()
}
}
}
mCounter++;
mCounter %= 65000;
}
return mIsOnDestination;