implemented check for leaving the board by PacMan