diff options
| author | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2015-05-03 01:09:19 +0200 |
|---|---|---|
| committer | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2015-05-03 01:09:19 +0200 |
| commit | cfc5d425f68c1a98b86ef91d92ac82785d0f33a2 (patch) | |
| tree | 8b6467a417c2e37b296f45a5a80f3673c2ed4d6d /src/Controllers/ConsoleController/ConsoleController.cpp | |
| parent | 4716e4d231a26c45fa7d4e38a79f4f44c3b8348a (diff) | |
Correct bug on merging and pop number
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; + } +} |
