I know how to add a trailer behind a missile, but I am having trouble getting the right coordinates, the trailer is a bit off.
So, first, I rotate the image so it is facing the target and render it:
float rotation = (float) getAngle(x, y, targetX, targetY);
g.rotate(x, y, rotation + 90);
g.drawImage(missile, x, y);
Then, I try to render the trailer behind the missile like this:
if(trailer != null)
{
g.rotate(x, y + realHeight, rotation + 90);
stage.append(trailer.getClone(x, y + realHeight));
}
And finally, I make the rotation normal:
[quote]g.rotate(0, 0, 0);
[/quote]
Obviously this doesn’t work.
Any one have any idea?