fixed reversi colors being switched, causing multiple issues

This commit is contained in:
Ticho Hidding
2025-12-08 17:14:31 +01:00
parent 3a8b1c2454
commit adc7b1a8f3
3 changed files with 12 additions and 13 deletions

View File

@@ -89,12 +89,6 @@ public final class App extends Application {
setKeybinds(root); setKeybinds(root);
stage.setFullScreenExitKeyCombination(
new KeyCodeCombination(
KeyCode.F11
)
);
LoadingWidget loading = new LoadingWidget(Primitive.text( LoadingWidget loading = new LoadingWidget(Primitive.text(
"Loading...", false), 0, 0, Integer.MAX_VALUE, false, false // Just set a high default "Loading...", false), 0, 0, Integer.MAX_VALUE, false, false // Just set a high default
); );
@@ -154,6 +148,11 @@ public final class App extends Application {
escapePopup(); escapePopup();
} }
}); });
stage.setFullScreenExitKeyCombination(
new KeyCodeCombination(
KeyCode.F11
)
);
} }
public void escapePopup() { public void escapePopup() {

View File

@@ -65,9 +65,9 @@ public class ReversiController extends AbstractGameController<ReversiR> {
canvas.clearAll(); canvas.clearAll();
for (int i = 0; i < game.getBoard().length; i++) { for (int i = 0; i < game.getBoard().length; i++) {
if (game.getBoard()[i] == 0) { if (game.getBoard()[i] == 1) {
canvas.drawDot(Color.WHITE, i); canvas.drawDot(Color.WHITE, i);
} else if (game.getBoard()[i] == 1) { } else if (game.getBoard()[i] == 0) {
canvas.drawDot(Color.BLACK, i); canvas.drawDot(Color.BLACK, i);
} }
} }
@@ -109,7 +109,7 @@ public class ReversiController extends AbstractGameController<ReversiR> {
public void drawLegalPosition(int cell, int player) { public void drawLegalPosition(int cell, int player) {
Color innerColor; Color innerColor;
if (player == 1) { if (player == 0) {
innerColor = new Color(0.0f, 0.0f, 0.0f, 0.6f); innerColor = new Color(0.0f, 0.0f, 0.0f, 0.6f);
} }
else { else {

View File

@@ -39,10 +39,10 @@ public final class ReversiR extends AbstractGame<ReversiR> {
private void addStartPieces() { private void addStartPieces() {
this.setBoard(27, 1); this.setBoard(27, 0);
this.setBoard(28, 0); this.setBoard(28, 1);
this.setBoard(35, 0); this.setBoard(35, 1);
this.setBoard(36, 1); this.setBoard(36, 0);
updateFilledCellsSet(); updateFilledCellsSet();
} }
private void updateFilledCellsSet() { private void updateFilledCellsSet() {