1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| public void colorierCases(Pieton tableauPieton[][]){
int ns,eo,nsb,eob;
for(int i=0; i<10; i++) {
for(int j=0; j<30; j++) {
if (tableauPieton[i][0]=null){
ns=tableauPieton[i][0].getPositionNS();
eo=tableauPieton[i][0].getPositionEO();
tab[ns][eo].dessineCarreVert();
if (eo-1>=0)
tab[ns][eo-1].effaceContenu();
}
if (tableauPieton[i][29]!=null){
nsb=tableauPieton[i][29].getPositionNS();
eob=tableauPieton[i][29].getPositionEO();
tab[nsb][eob].dessineCarreRouge();
if (eob+1<30)
tab[nsb][eob+1].effaceContenu();
}
}
}
}
} |
Partager