danpost wrote...
With the following, no reference is kept:
addObject(new Player(), 100, 365);
Player player = new Player(); addObject(player, 100, 365);
public Player player;
public Dock() {
super(600, 400, 1);
player = new Player(); // retains reference
addObject(player, 300, 200); // wherever
// etc.public Shop shop;
public Room room;
public Dock() {
super(600, 400, 1);
shop = new Shop();
room = new Room();
prepare();
}
