Ya surement moyen de changer la couleur du curseur en effaçant l'original et en le recréant dans ta fenêtre de la couleur souhaiter mais comme j'ai jamais utilisé processing et que j'ai pas vraiment le temps de m'y pencher plus.
Ici je t'ai rajouter le numéro du joueur en bas de l'écran.
Pour ça j'ai agrandi la fenêtre, j'ai refresh à chaque nouveau draw pour pas que joueur 1 se superpose à joueur 2
et j'ai écris le text avec :
textSize(32);
text((joueur==1)?"Joueur 1":"Joueur 2", 10, 635);
fill(0, 102, 153);
int w = 7, h = 6, bs = 100, joueur = 1;
int [] [] board = new int [h] [w] ;
void setup() {
size (700, 650); ellipseMode (CORNER);
}
int p(int y, int x) {
return (y<0||x<0||y>=h||x>=w)?0:board[y][x];
}
int getWinner() {//rows, columns, diagonals
for(int y=0;y<h;y++)for(int x=0;x<w;x++)
if(p(y,x)!=0&&p(y,x)==p(y,x+1)&&p(y,x)==p(y,x+2)&&p(y,x)==p(y,x+3)) return p(y,x) ;
for(int y=0;y<h;y++)for(int x=0;x<w;x++)
if(p(y,x)!=0&&p(y,x)==p(y+1,x)&&p(y,x)==p(y+2,x)&&p(y,x)==p(y+3,x)) return p(y,x) ;
for(int y=0;y<h;y++)for(int x=0;x<w;x++)for(int d=-1;d<=1;d+=2)
if(p(y,x)!=0&&p(y,x)==p (y+1*d,x+1)&&p(y,x)==p (y+2*d,x+2)&&p(y,x)==p(y+3*d,x+3)) return p(y,x);
for(int y=0;y<h;y++)for(int x=0;x<w;x++)if(p(y,x)==0) return 0;
return -1; //tie
}
int nextSpace (int x) {
for(int y=h-1;y>=0;y--) if (board[y][x]==0) return y;
return -1;
}
void mousePressed() {
int x = mouseX / bs, y = nextSpace(x) ;
if(y>=0) {
board [y][x] = joueur;
joueur = joueur==1?2:1;
}
}
void draw() {
if (getWinner()==0) {
background(0,191,255);
for(int j=0;j<h;j++) for(int i=0;i<w;i++){
fill (0,0,300);
rect(i*bs, j*bs,bs,bs);
fill (255,255,255);
ellipse (i*bs,j*bs,bs,bs);
if(board[j][i]>0){
fill(board[j][i]==1?255:255, board[j][i]==2?255:0,0);
ellipse (i*bs,j*bs,bs,bs);
}
}
textSize(32);
text((joueur==1)?"Joueur 1":"Joueur 2", 10, 635);
fill(0, 102, 153);
}else {
background(0,191,255); fill(0);text("Le gagnant est : "+getWinner()+". Appuyer sur espace pour relancer", width/2,height/2); textAlign(CENTER);
if(keyPressed&&key==' ') {
joueur=1; for (int y=0;y<h;y++) for (int x=0;x<w;x++) board [y][x]=0;
}
}
}