forked from jaildesigner-jailgames/coffee_crisis
code reorganized
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user