protected void processPath() {

		while (activeNode.getxCoord() != endX || activeNode.getyCoord() != endY
				&& !openNodes.isEmpty()) {
			checkOpenNodes();
			activeNode.mapPiece.togglePath();
			pathNodes.add(activeNode);
			if (activeNode.getxCoord() == endX
					&& activeNode.getyCoord() == endY) {
			} else {
				openNodes.remove(activeNode);
				closedNodes.add(activeNode);
				addNodesNeighbours();
				for (AStarNode neighbourNode : neighbourNodes) {
					if (closedNodes.contains(neighbourNode)) {
						calculateG(neighbourNode);
						neighbourNode.setParent(activeNode);
					} else if (openNodes.contains(neighbourNode)) {
						calculateG(neighbourNode);
						neighbourNode.setParent(activeNode);
					} else {
						openNodes.add(neighbourNode);
						calculateG(neighbourNode);
					}
				}
			}

		}
	}