Take Worms aim cursor for example, whenever you press up it rotates going up around the player, the same thing when you press down but going that direction instead of up.
How can I rotate an object like that using also the keyboard?
Develop games in your browser. Powerful, performant & highly capable.
You can set the Origin image point outside of the image and simply rotate the sprite. For example, if your sprite is 10x10 pixels, set the Origin image point position at (100, 5)
Or you can do this with math:
x = center.X+RADIUS*cos(angle)
y = center.Y+RADIUS*sin(angle)
Thank you so much!, I got it to rotate around the player but not making it a full 360° circle around it, it doesn't really matter, I find this way better for my game :]