Hello everyone,
I have 2 questions and I think they both deal with math.
1. How do i get the x,y, x+ width and y+ height of a sprite after setting a rotation (corners of sprite)
image 1 (white background image)
2. how do i make a sprite look at the position of the mouse ( rotate to where the mouse is)
I tried various version and this seems to give me the closes one
var angle = Math.atan2(mouseX - (boxIMG.position.x), -(mouseY - boxIMG.position.y));
then set the rotation to that
boxIMG.rotation = angle; but is not working correctly (black background image)