So I want my sprite to rotate at my players position, it rotates, but appears some place to the left of the player. I cannot find anything on the internet that helped me with this.
Here's my code
at.setToRotation(Math.PI / 2, Main.p.x, Main.p.y / 2);
if (!rotate) {
g.setTransform(at);
rotate = true;
}
g.drawImage(item0, Main.p.x + 1, Main.p.y - 15, null);
Yes I know it's not the best code, I'm still a beginner, don't be too harsh please.