I
fixed a bug with "untouchable" enemy double in the right end of scroller (see the piece of code I used to solve this problem below). But now enemy sprite begun to visibly shift right after scrolling till right end of background.
Before:
Fichier joint :
After:
Fichier joint : 
What is reason of this?
if((p1&JOY_LEFT)&&(x<=32&&x>0))
{
scrl_x--;
if ((scrl_x>FRONT_MIN_X)&&(enemyX<320+(enemy_spr.maxWidth*16)))
{
enemyX++;
aSpriteSetPos(&Enemy,enemyX,enemyY);
}
}
if((p1&JOY_RIGHT)&&(x>=288&&x<320))
{
scrl_x++;
if ((scrl_x<FRONT_MAX_X)&&(enemyX>0-(enemy_spr.maxWidth*16)))
{
enemyX--;
aSpriteSetPos(&Enemy,enemyX,enemyY);
}
}