I'm trying to make a game where the player sometimes have to rotate, but I can't figure out a way to make it rotate more each time, here's what I've got: Graphics2D g2d = (Graphics2D) g;
AffineTransform at = new AffineTransform();
at.translate(300, Main.height - 115);
if(rotateright) {
at.rotate(Math.PI / 15);
} else if(rotateleft) {
at.rotate(Math.PI / 15);
}
at.scale(0.125, 0.125);
at.translate(-texture.getWidth() / 2, -texture.getHeight() / 2);
g2d.drawImage(texture, at, null);
This method makes it rotate just fine, but I can't find a way to make it rotate more each time, so this method pretty much just rotates it, but only once, and then it just stops. Is there anyway to add to the rotation or something?