code reorganized

This commit is contained in:
2021-02-26 17:51:46 +01:00
parent 190f1e9a47
commit 765b64c29c
31 changed files with 3111 additions and 2547 deletions

View File

@@ -33,6 +33,10 @@ void MovingSprite::init(float x, float y, int w, int h, float velx, float vely,
setAccelX(accelx);
setAccelY(accely);
// Establece el zoom W,H del sprite
setZoomW(1);
setZoomH(1);
// Establece la textura donde están los gráficos para el sprite
setTexture(texture);
@@ -56,7 +60,8 @@ void MovingSprite::move()
// Muestra el sprite por pantalla
void MovingSprite::render()
{
mTexture->render(mRenderer, (int)mPosX, (int)mPosY, &mSpriteClip);
//mTexture->render(mRenderer, (int)mPosX, (int)mPosY, &mSpriteClip);
mTexture->render(mRenderer, (int)mPosX, (int)mPosY, &mSpriteClip, mZoomW, mZoomH);
}
// Establece el valor de la variable
@@ -95,6 +100,18 @@ float MovingSprite::getAccelY()
return mAccelY;
}
// Establece el valor de la variable
float MovingSprite::getZoomW()
{
return mZoomW;
}
// Establece el valor de la variable
float MovingSprite::getZoomH()
{
return mZoomH;
}
// Establece el valor de la variable
void MovingSprite::setPosX(float x)
{
@@ -129,4 +146,16 @@ void MovingSprite::setAccelX(float x)
void MovingSprite::setAccelY(float y)
{
mAccelY = y;
}
// Establece el valor de la variable
void MovingSprite::setZoomW(float w)
{
mZoomW = w;
}
// Establece el valor de la variable
void MovingSprite::setZoomH(float h)
{
mZoomH = h;
}