diff --git a/src/snakeGame.cpp b/src/snakeGame.cpp index b21a448..6bbaf15 100644 --- a/src/snakeGame.cpp +++ b/src/snakeGame.cpp @@ -1,5 +1,4 @@ #include -#include #include #include "windowGrid.hpp" #include "snakeGame.hpp" @@ -72,10 +71,12 @@ void snakeGame::events () window.close(); break; case Event::LostFocus: - snakeObj.isMoving = false; + if (!interface.isMenu) + snakeObj.isMoving = false; break; case Event::GainedFocus: - snakeObj.isMoving = true; + if (!interface.isMenu) + snakeObj.isMoving = true; break; case Event::KeyPressed: if (!is_keypressed) @@ -150,6 +151,7 @@ void snakeGame::events () score = 0; resetGame(); interface.isMenu = true; + snakeObj.isMoving = false; } } }