void (Graphics g, int x, int y, int width, int height, char dir) { int cx = x + width / 2 - 2; int cy = y + height / 2 - 2; for (int i = 0; i < 4; i++) { if (dir == 'N') { // north g.drawLine(cx + 1 - i, cy + i, cx + 1/*2*/ + i, cy + i); } else if (dir == 'W') { // west g.drawLine(cx + i, cy + 1 - i, cx + i, cy + 1/*2*/ + i); } else if (dir == 'S') { // south g.drawLine(cx + 1 - i, cy + 4 - i, cx + 1/*2*/ + i, cy + 4 - i); } else { // east g.drawLine(cx + 4 - i, cy + 1 - i, cx + 4 - i, cy + 1/*2*/ + i); } } }