I have a program, and I would like to rotate the image (4 directions)
I am wondering if there is an easy way to rotate the image. here is the code, and where I would like to rotate the image.
import java.awt.*;
import java.awt.image.ImageObserver;
import java.io.*;
import javax.imageio.ImageIO;
public class Player {
int x = 50;
int y = 50;
boolean up = false, down = false, left = false, right = false;
Image playerImage;
Image playerDrawn;
Rectangle playerRect = new Rectangle (x, y, 32, 32);
Player (int playerNumber){
try {
playerImage = ImageIO.read(new File ("Images/soldier" + playerNumber + ".png"));
playerDrawn = playerImage;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void updateRectangle (){
playerRect = new Rectangle (x, y, 32, 32);
}
public void updateImage(){
}
public void shoot(){
}
}
Thanks for any help