For each part of the train that u have, make an Image obj with a graphics 2d object for it. Make sure that the Image is big enough so that the train part can rotate 360 degrees and always be shown.
Then make an int for each of these images to record their current radius.
You could use arrays of graphics contexts, and images and ints.
Then when u are moving the train it has an up/down/left/right speed.
So say u are turning moving up, and are going to turn left. You will slowly decrease the up speed, and increase the left speed. And as you do that, you want to rotate the image so that it looks like it is actaully turning.
so u could have some code like: (when drawing)
1 2 3 4 5
| g2d1.rotate(Math.toRadians(angle)); g2d1.drawImage(img,center,of_the_image,this); ...
g.drawImage(traincar,xpos,ypos,this); |
So that the image that is paints is rotated.
Is that more of a better explanation? If you have anymore questions just post again. I think I know what you may ask...
