I wrote the following code.But there is some errors.
private void randomShuffleChessPieces() {
for (int y1=0; y1< 7 ;y1++) {
for (int x1=0; x1<7;x1++) {
int rn = GWorld.random(0,31);
int yn = GWorld.random(0,31);
int x2=rn;
int y2=yn;
shuffleTwoChessPieces(x1,y1,x2,y2);
}
}
}
private void shuffleTwoChessPieces(int x1, int y1, int x2, int y2) {
Chess c1 = (Chess) GWorld.getOneObjectAt(x1,y1,"Chess");
Chess c2 = (Chess) GWorld.getOneObjectAt(x2,y2,"Chess");
setLocation(x1,y1);
setLocation(x2,y2);
//It told me that it cannot find the method setLocation.However,I do not understand what is wrong with it
}