add comments on players collision

This commit is contained in:
Mylloon 2022-01-02 16:34:54 +01:00
parent 27e8808349
commit b46125c282
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -331,11 +331,10 @@ void idle(void) {
} }
/* Anti-collision entre joueurs */ /* Anti-collision entre joueurs */
if(_joueurA.position != posJoueurA && _plateau[posJoueurA] != 6 && _plateau[_joueurA.position] != 6) { if(_joueurA.position != posJoueurA && _plateau[posJoueurA] != 6 && _plateau[_joueurA.position] != 6) { // si position différente et pas une bombe
if(_joueurA.position != -1) _plateau[_joueurA.position] = 0; // on met l'ancienne position a un bloc vide
_plateau[_joueurA.position] = 0; _joueurA.position = posJoueurA; // on change la position dans perso_t
_joueurA.position = posJoueurA; _plateau[posJoueurA] = 2; // on met a jour le plateau
_plateau[posJoueurA] = 2;
} }
@ -392,11 +391,10 @@ void idle(void) {
} }
/* Anti-collision entre joueurs */ /* Anti-collision entre joueurs */
if(_joueurB.position != posJoueurB && _plateau[posJoueurB] != 6 && _plateau[_joueurB.position] != 6) { if(_joueurB.position != posJoueurB && _plateau[posJoueurB] != 6 && _plateau[_joueurB.position] != 6) { // si position différente et pas une bombe
if(_joueurB.position != -1) _plateau[_joueurB.position] = 0; // on met l'ancienne position a un bloc vide
_plateau[_joueurB.position] = 0; _joueurB.position = posJoueurB; // on change la position dans perso_t
_joueurB.position = posJoueurB; _plateau[posJoueurB] = 3; // on met a jour le plateau
_plateau[posJoueurB] = 3;
} }
} }