public class RedCar extends Car { // --------------------------------------------------------- constructor public RedCar(int xOriginPoint) { super(RED, xOriginPoint, 2, carRIGHT); } public boolean isPathClear(Grid tempGrid) { for (int i = xOriginPoint+2; i < tempGrid.cols;i++) { if (DEBUG) println("in pathclear loop " + i); if (i > tempGrid.cols-1) { if (DEBUG) println("reached end"); return true; } if (tempGrid.filled[i][2]) { if (DEBUG) println("square " + i + " 2 is blocked"); return false; } } return true; } }