I create an object in box2d, lets say a square and I want to make many copies of square with different coordinates so I can call it with
Square square = new Square(int x, int y)
Inside square I created a method that changes the square color. What I'm trying to do is create multiple instances of square
square = new Square(2, 4);
square = new Square(9, 7);
.
.
.
and when I call square.changeColor()
I want all of them to change, what would be the best way of doing this?