I want my sprite to go back and forth, when it reaches the end of the screen.
right now its not moving at all.
Here is my function and the call to it
void IGE2D::SideStep(int iSpriteNum, int ix, int ixx, int iMove)
{
int iCurX = dbSpriteX(iSpriteNum);
if(dbSpriteX(iSpriteNum) > ixx)
{
bLeft = true;
bRight = false;
}
else if(dbSpriteX(iSpriteNum) < ix)
{
bLeft = false;
bRight = true;
}
if(bLeft == true)
{
iCurX = iCurX - iMove;
}
else if(bRight == true)
{
iCurX = iCurX + iMove;
}
dbSprite(iSpriteNum,iCurX,dbSpriteY(iSpriteNum),iSpriteNum);
}
Sprites.SideStep(ICBANNER,0,600,3);