diff --git a/Board.h b/Board.h index 97d5ece..5422077 100644 --- a/Board.h +++ b/Board.h @@ -118,7 +118,7 @@ void calculateNearbyBombs(){ } void setDebug(int i, int j){ if(board[i][j]->getIsMine()) { - board[i][j]->setTexture("../Project 3 - Minesweeper Spring 2024/files/images/debug.png"); + board[i][j]->setTexture("../Project 3 - Minesweeper Spring 2024/files/images/mine.png"); board[i][j]->setSprite(); } } diff --git a/DebugButton.h b/DebugButton.h index 47d30c3..2614865 100644 --- a/DebugButton.h +++ b/DebugButton.h @@ -14,5 +14,6 @@ class DebugButton : public Button{ if(sprite.getGlobalBounds().contains(static_cast(mousePos))){ return true; } + return false; } }; \ No newline at end of file diff --git a/GameWindow.h b/GameWindow.h index a3a07ac..71e865b 100644 --- a/GameWindow.h +++ b/GameWindow.h @@ -25,7 +25,8 @@ class GameWindow{ board.setBombs(); board.calculateNearbyBombs(); - DebugButton debugButton = DebugButton((numOfCols * 32)-304, 32*(numOfRows + 0.5), "../Project 3 - Minesweeper Spring 2024/files/images/debug.png"); + DebugButton debugButton = DebugButton((numOfRows * 32)-304, 32*(numOfCols + 0.5), "../Project 3 - Minesweeper Spring 2024/files/images/debug.png"); + cout<sprite); @@ -41,14 +43,14 @@ class GameWindow{ board.mouseRightClicked(sf::Mouse().getPosition(window), i, j); } else if (sf::Mouse().isButtonPressed(Mouse::Left)){ -// if(debugButton.buttonPressed(sf::Mouse().getPosition(window))){ + if(debugButton.buttonPressed(sf::Mouse().getPosition(window))){ for(int bombs = 0; bombs < numOfRows; bombs++){ for(int b = 0; b < numOfCols; b++){ board.setDebug(bombs, b); if(board.getBoard()[bombs][b]->getIsMine()){ } } -// } + } } board.openTile(sf::Mouse().getPosition(window), i, j); }