class Square { int x,y; int w = 60; color c; color border; int team = 0; // boolean highlighted = false; // boolean marked = false; Square(int x_,int y_) { x = x_; y = y_; c = color(100); border = color(255); team = 0; } void createBorder() { c = color(0); team = 4; border = color(0); } void createNyeh() { c = color(255); team = 3; } void display() { stroke(0); fill(c); rect(x,y,w,w); } void createTuh() { c = color(2,24,211); team = 1; // If there is a piece next to this new one, switch its color: squares[mouseX/60+1][mouseY/60].switchTeam(); squares[mouseX/60-1][mouseY/60].switchTeam(); squares[mouseX/60][mouseY/60+1].switchTeam(); squares[mouseX/60][mouseY/60-1].switchTeam(); } void createFuh() { c = color(6,124,21); team = 2; // If there is a piece next to this new one, switch its color: squares[mouseX/60+1][mouseY/60].switchTeam(); squares[mouseX/60-1][mouseY/60].switchTeam(); squares[mouseX/60][mouseY/60+1].switchTeam(); squares[mouseX/60][mouseY/60-1].switchTeam(); } int getTeam() { return team; } void switchTeam() { if (team == 1) { c = color(6,124,21); team = 2; } else if (team == 2) { c = color(2,24,211); team = 1; } } // end switchTeam }