I am doing a small game project named "puzzle game". Every piece of the puzzle should can be both moved and rotated. Whether I move the piece or roate the piece, I just do the same mouseEvent that move my mouse. The differrence is that: 1) When the mousePoint is at the centre of piece , I will do pressMove; 2) When the mousePoint is at the edge of piece, if I move mouse, the piece will rotate according to the caculated angle.
But now, I don't exactly know how I do this.THANK YOU FOR ANY HELP.
For the roate, there is a example in this website. (http://www.gamefromscratch.com/post/2012/11/18/GameDev-math-recipes...)
I want to do the same thing for rotating. And can move at the same time.