Browse Source

Merge remote-tracking branch 'origin/main'

# Conflicts:
#	target/classes/BattleShip/AIGridGUI.class
main
fdai4581 2 years ago
parent
commit
c9200e2fd2
  1. 8
      src/main/java/BattleShip/AIGridGUI.java
  2. BIN
      target/classes/BattleShip/AIGridGUI.class

8
src/main/java/BattleShip/AIGridGUI.java

@ -343,7 +343,7 @@ public class AIGridGUI extends JPanel {
if(s == null) { if(s == null) {
//If no ship in that cell, mark as a miss. //If no ship in that cell, mark as a miss.
text = "Other player missed. Your turn."; text = "Other player missed. Your turn.";
b.setBackground(Color.BLUE);
b.setBackground(Color.lightGray);
} else { } else {
//Check if guess killed a ship. //Check if guess killed a ship.
killed = s.counter(); killed = s.counter();
@ -522,13 +522,13 @@ public class AIGridGUI extends JPanel {
BSButton bsb = buttons.get(cell.getGridLocation() + (i * columns)); BSButton bsb = buttons.get(cell.getGridLocation() + (i * columns));
//If mouse entered, highlight cells via lowered bevel. //If mouse entered, highlight cells via lowered bevel.
if(action == 1) { if(action == 1) {
bsb.setBorder(raisedbevel);
bsb.setBorder(loweredBevel);
} else { } else {
//If mouse released, place ship and color ship cells. //If mouse released, place ship and color ship cells.
if(action == 2) { if(action == 2) {
bsb.setCellContents(shipToPlace); bsb.setCellContents(shipToPlace);
bsb.setBackground(Color.gray);
bsb.setBorder(raisedbevel);
bsb.setBackground(Color.blue);
bsb.setBorder(loweredBevel);
} else { } else {
//If mouse exited, unhighlight cells. //If mouse exited, unhighlight cells.
bsb.setBorder(compound); bsb.setBorder(compound);

BIN
target/classes/BattleShip/AIGridGUI.class

Loading…
Cancel
Save