Skip to content

Commit

Permalink
Merge pull request #61 from bardddd/Issue_#60
Browse files Browse the repository at this point in the history
Fixed pieces showing sideways
  • Loading branch information
MrMystery10-del committed Apr 22, 2023
2 parents bdee586 + 0c594a6 commit c2bf904
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/gui/controllers/BoardGuiController.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ public BoardGuiController(Board board, BoardGui gui, GameStateGui gameStateGui)
* update the chessboard gui with the details from the Piece board
*/
public void updateBoard() {
for (int j = 0; j < 8; j++)
for (int i = 0; i < 8; i++) {
var image = convertToPiece(board.getGameBoard())[i][j];
var update = gui.getSquares()[i][j];
for (int row = 0; row < 8; row++)
for (int col = 0; col < 8; col++) {

var image = convertToPiece(board.getGameBoard())[row][col];
var update = gui.getSquares()[col][row]; //this is flipped and I can't figure out why... too bad!

if (image != null)
update.setIcon(new ImageIcon(ImageManager.getPiece(image)));
}
Expand Down

0 comments on commit c2bf904

Please sign in to comment.