/** * Helper method for walk() * * @param dir * @return true if there is no wall in this direction */ private boolean checkMove(int dir) { // obtain appropriate index for direction (CW_BOT, CW_TOP ...) // for given direction parameter int a = angle / 90; if (dir == -1) a = (a + 2) & 3; // check if cell has walls in this direction // returns true if there are no walls in this direction return mazecells.hasMaskedBitsFalse(px, py, Constants.MASKS[a]); }