private void calculateG(Node node) {
		Tile t = MyzoGEN.getOutput().getTile(new Point(node.x, node.y));
		if (node.parent != null && t != null) {
			int dir = directionFromParent(node);
			if (dir == 1)
				node.G = roundHeight(t.height);
			else if (dir == 0)
				node.G = node.parent.G + DIAGONAL_MOVE_COST;
		}
		if (details) System.out.println("("+node.x+","+node.y+") G = "+node.G);
	}