|
@ -349,6 +349,16 @@ public class AIGridGUI extends JPanel { |
|
|
if(!unkilledCells) { |
|
|
if(!unkilledCells) { |
|
|
randomGuess = true; |
|
|
randomGuess = true; |
|
|
} |
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
//If cell hit but not killed, mark cell appropriately. |
|
|
|
|
|
text = "Other player got a hit. Your turn."; |
|
|
|
|
|
b.setBackground(Color.red); |
|
|
|
|
|
//If previously random guessing, switch to locking onto the hit cell. |
|
|
|
|
|
if(randomGuess) { |
|
|
|
|
|
f = b.getGridLocation(); |
|
|
|
|
|
randomGuess = false; |
|
|
|
|
|
} |
|
|
|
|
|
cellsHit[guessLocation] = true; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|