Hi, here's what i want to do:
I create an image (32x2) with a given rotation at a given x and a given y.
Then, I want to add another image (from the same class) next to it.
I can do it when the rotation is 0, but when the rotation is "int != 0", the new x of the new image must be smaller, you know, so i've been trying this code and i don't know what's wrong with it...
where 16 is the: image.getWidth()/2
This code compiles but doesn't put the middle of the second image next to the end of the first, it's not accurate at all...
public void dispersion()
{
if(getWorld() !=null)
{
if(isLightning == true)
{
Actor lightning = (Actor)getWorld().getObjects(Lightning.class).get(0);
double nextX = 16*Math.cos(Math.abs(lightning.getRotation()));
double nextY = 0;
Lightning lightningNext = new Lightning(lightning.getRotation()+60);
getWorld().addObject(lightningNext, (int)(lightning.getX()+ nextX), lightning.getY()+ (int)nextY);
isLightning = false;
}
}
}

