Hi to all,
My average height is not working for some reason.
I get the height from all the Ballon in my sceneario (via the light hoogte)
And I get the average height. then i set them to the average height. But for some reason they dont go to the average height. What am I missing?
public void setAlleBallonnenOpGemiddeldeHoogte()
{
//bepaal gem hoogte
int totaleHoogte = 0;
List<Ballon> alles = getObjects(Ballon.class);
for(Ballon ballon : alles)
{
int hoogte = ballon.getY();
totaleHoogte = totaleHoogte + hoogte;
}
int gemiddelde = totaleHoogte / alles.size();
//zet op gemiddelde hoogte
for(Ballon ballon : alles)
{
int x = ballon.getX();
int y = ballon.getY();
ballon.setLocation(x, y);
}
}

