ok i need help with java code?
ok when i click the leter on the screen to switch with the black square it doesnt go ( i am doing switch game where the pix is scrambled and you have to put them togather this is my code
public void advanceFrame(double timePassed) {
temp = "";
Coordinate hit=getPlayer().getMouse().getLocation();
if(hit != null && getPlayer().getMouse().pressed()){
for (int r = 0; r < BOARD_DIMENSIONS; r++){
for (int c = 0; c < BOARD_DIMENSIONS; c++){
if(pix[r][c].intersects(hit)){
if(pix[r][c].toString() != ""){
temp = pix[r][c].toString();
pix[r][c] = new StringSprite("");
}
if(pix[r][c].toString() == ""){
pix[r][c] = new StringSprite(temp);
}
}
}
}
}
}
this is in my advance frame
|