27Fermer29
VasiliyFamiliyaLe 25/05/2018 à 12:57
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: tromb Fichier joint : xi1e

After: tromb Fichier joint : pIjX

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); } }