What I basically am going for is a platform game where you can advance through stages by getting past enemies and such. You will get different weapons as you advance and pick things up. I would like for these different weapons you pick up to be able to be pointed in the direction that the mouse is currently at.
Since it’s a little hard to example it right I found a video that pretty much shows exactly what I want but with a different sprites used.
http://www.youtube.com/watch?v=8W7WSkQq5SU
So lets say this is the image I would use for one of the weapons:

How would I go about adjusting it (pseudo code) to make the right point of the pickaxe be pointed in the same direction of the mouse?
I just looking for some pseudo code of how you may go about doing this the most efficient way and the smoothest way.
If you are using Java
Graphics2Dthen you have to useAfflineTransform. To do this first translate to the point of the axis of your pickaxe. Then you would rotate by the direction to the mouse which can be found usingatan2. then you draw the axe so the offset matches the axis point.Pseudocode: