Very cool! I wonder how you did the code for detecting a proper mouse "rotation"?
Viewing post in Interdimensional Spinning Championship jam comments
Thanks! It's actually simpler than it looks. Instead of thinking about tracking the mouse's movement direction, track the angle of the cursor around the center of the screen.
Every frame I do three things:
- Find the cursor's position relative to screen center; that gives me a little arrow pointing from the middle of the screen out to the cursor.
- Measure that arrow's angle (one
atan2; in Godot it's justoffset.angle()). - Compare it to last frame's angle. The difference is how far you swept around the center this frame; the sign of that difference tells me clockwise vs. counter-clockwise.
I tried to understand how Osu did it and apply it as best I could for my use case.
No gesture recognition, no recording the path, just "what angle is the cursor at, and how fast is that angle changing."
Thank you for playing and good luck with the voting!