diff options
Diffstat (limited to 'src/Controllers/ConsoleController/ConsoleController.cpp')
| -rw-r--r-- | src/Controllers/ConsoleController/ConsoleController.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Controllers/ConsoleController/ConsoleController.cpp b/src/Controllers/ConsoleController/ConsoleController.cpp index d91e807..479b25d 100644 --- a/src/Controllers/ConsoleController/ConsoleController.cpp +++ b/src/Controllers/ConsoleController/ConsoleController.cpp @@ -33,10 +33,11 @@ void ConsoleController::run() keyPress=this->waitArrowKeyPress(); //Apply move - m_game.swipe(keyPress); + bool moveDone=m_game.swipe(keyPress); //Pop a random number on the grid - m_game.popRandomNumber(); + if(moveDone) + m_game.popRandomNumber(); //Cout grid m_game.coutGrid(); @@ -95,3 +96,10 @@ kbdh::Direction ConsoleController::waitArrowKeyPress() return keyPress; } + + +void ConsoleController::clearScreen(){ + for(int i;i<100;i++){ + std::cout << std::endl; + } +} |
