Skip to content

Commit

Permalink
Pause hides flags
Browse files Browse the repository at this point in the history
  • Loading branch information
EAOZONE committed Apr 20, 2024
1 parent 4021d4d commit 0a8e4c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion GameWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class GameWindow{
for(int i = 0; i < numOfCols; i++){
for(int j = 0; j < numOfRows; j++) {
window.draw(board.getBoard()[i][j]->sprite);
if(board.getBoard()[i][j]->getState() == flag){
if(board.getBoard()[i][j]->getState() == flag && !paused){
window.draw(board.getFlag(i, j));
}
}
Expand Down
6 changes: 5 additions & 1 deletion Tile.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ class Tile : public GameObject{
}

void backToNormal(){
if(state != hidden) {
if(state == flag){
setTexture("../Project 3 - Minesweeper Spring 2024/files/images/tile_hidden.png");
setSprite();
}
else if(state != hidden) {
if (isMine) {
setTexture("../Project 3 - Minesweeper Spring 2024/files/images/mine.png");
setSprite();
Expand Down

0 comments on commit 0a8e4c6

Please sign in to comment.