However, let's figure out what's the problem, so that I can know solution:
At begin of Board class, I've declared:
1 2 3
| private Border blueBorder[] = new Border[2]; private Border redBorder[] = new Border[2]; private Border greenBorder[] = new Border[2]; |
As well I initialized them:
1 2 3 4 5 6 7
| for (int i = 0; i < 1; i++) { for (int j = 0; j < 2; j++) { redBorder[j] = new Border("border_red.png", j * (BOARD_WIDTH - 110), i * 300); blueBorder[j] = new Border("border_blue.png", j * (BOARD_WIDTH - 110), BOARD_HEIGTH - 15); greenBorder[j] = new Border("border_green.png", j * 345, 15); } } |
So, they're all using the same class, and as you can see where I init them, it's constructor which receives parameters (image, posX, posY).
What do you think is solution ?