boolean function ( Player arg0 , Action arg1 ) { switch ( arg1 ) { case LEFT : return arg0 . getX ( ) > 0 ; case RIGHT : return arg0 . getX ( ) + 1 < board . getSizeX ( ) ; case DOWN : return arg0 . getY ( ) + 1 < board . getSizeY ( ) ; case UP : return arg0 . getY ( ) > 0 ; default : return false ; } }
checking if player tries to move out of bounds . concode_field_sep int BOARD_SIZE_X concode_elem_sep int BOARD_SIZE_Y concode_elem_sep Board clonedBoard concode_elem_sep boolean restart concode_elem_sep Display display concode_elem_sep int SCORE_LIMIT concode_elem_sep String HELP_FORMAT concode_elem_sep int PLAYER_COUNT concode_elem_sep PlayerPosition playerPosition concode_elem_sep Board board concode_elem_sep Player[] player concode_field_sep int playerRetry concode_elem_sep boolean checkScore concode_elem_sep void move concode_elem_sep void removePlayerFromPreviousPosition concode_elem_sep boolean isColliding concode_elem_sep boolean canMoveInDirection concode_elem_sep void run concode_elem_sep void addScoreAndSetNewPosition concode_elem_sep void initializeGame