Hello, I am trying to create a game that has 3 counters: health, score and fuel. I am trying to pass a reference to all those to my spaceship. I have managed to do that for fuel, but I don't know how to reference the rest. Here is my code:
In the section I was thinking of putting but that doesn't work. What should I do?
private void prepare() { FuelCounter fuelcounter = new FuelCounter(); addObject(fuelcounter,41,34, false); //Adds the fuel counter and makes it non-scrollable object. HealthCounter healthcounter = new HealthCounter(); addObject(healthcounter,83,34, false); setMainActor(new Spaceship(fuelcounter), 0, 0); mainActor.setLocation(300,3500);
setMainActor(new Spaceship(fuelcounter), 0, 0); mainActor.setLocation(300,3500);
setMainActor(new Spaceship(fuelcounter, healthcounter), 0, 0); mainActor.setLocation(300,3500);