Hello all,
We have an assignment for school and we need some help.
One restriction is that we have to use an arraylist.
We have the following arraylist:
ArrayList<Tankkogel> kogelLijst = new ArrayList<Tankkogel>(); // Tankkogel means Tank bullet in English.
The arraylist is already working and we can fire some bullets from the tank.
We are firing the bullets with the following code:
getWorld().addObject (kogelLijst.get(0), getX(), getY());
Ok, our problem:
When we are firing some bullets, they all have the same rotation.
We have a constructor in the class Tankkogel:
public Tankkogel(int rot)
{
//Rotatie meegeven aan de kogel hoe de tank staat
setRotation(rot);
}
We can use the setRotation function, but how can we give the parameter "rot" to the constructor with the following code:
getWorld().addObject (kogelLijst.get(0), getX(), getY());
Thank you very much for your interest and we hope we can find the solution in this topic.
Kind regards,
Nick and Mikey
(HHS)

