summaryrefslogtreecommitdiff
path: root/src/Game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Game.cpp')
-rw-r--r--src/Game.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Game.cpp b/src/Game.cpp
index a703913..82c5eb7 100644
--- a/src/Game.cpp
+++ b/src/Game.cpp
@@ -147,6 +147,41 @@ void Game::displayBoard() {
}
}
+void Game::bombCheck(){
+ for(int x=0; x < boardWidth; x++){
+ for(int y=0; y < boardHeight; y++){
+ if(tileMap[x][y] == 1){
+ int bombsAround[boardWidth][boardHeight];
+
+ if(bombMap[x-1][y-1] == true){
+ bombsAround[x][y]++;
+ }
+ if(bombMap[x][y-1] == true){
+ bombsAround[x][y]++;
+ }
+ if(bombMap[x+1][y-1] == true){
+ bombsAround[x][y]++;
+ }
+ if(bombMap[x-1][y] == true){
+ bombsAround[x][y]++;
+ }
+ if(bombMap[x+1][y] == true){
+ bombsAround[x][y]++;
+ }
+ if(bombMap[x-1][y+1] == true){
+ bombsAround[x][y]++;
+ }
+ if(bombMap[x][y+1] == true){
+ bombsAround[x][y]++;
+ }
+ if(bombMap[x+1][y+1] == true){
+ bombsAround[x][y]++;
+ }
+ }
+ }
+ }
+}
+
void Game::input(){
std::string input;