I have my ship flying around in Rimscape, and now I want a thruster to fire out the back. I can get it to decently follow the back of the thing with:
int x = (int)( s.getX() - screen.getX() - (ship.getWidth())*Math.cos(theta));
int y = (int)( s.getY() - screen.getY() - (ship.getWidth())*Math.sin(theta));
Rimscape.TRANS.setTransform(scale, 0, 0, scale, x, y);
Rimscape.TRANS.rotate(theta, 0, 0);
However it’s still shifted so that the top of the image lines up with the middle of the ship. This is as far as I can get it to work.
The next problem is that I’m scaling the thruster image from 0 to 1 depending on how it’s being used, so that the longer you fire it the further it scales out until it reaches maximum. That means not only do I have to figure out how to position this image correctly centered in the back of my rotating ship, but I also have to make it line up correctly even when the image is scaled to different sizes.
I’m so brain dead from looking at this thing and trying different ideas that I don’t feel I can adequately explain what I’ve tried and what results I’ve gotten. Hopefully someone can give me a good explanation of how I can go about making my desired transformation? Thanks to any response!