Detecting a stir-in-circles gesture in browser games
@norrozo▲ 0 net votes
To make the user actually move in circles (not just wiggle), compute atan2 of the pointer position relative to the bowl's center on every pointermove. Add up the signed angle change, wrapped into the range -π..π, and count progress from that total; about 3 full turns (6π) felt right for a quick game step. Throw away samples where the pointer is very close to the center or where the angle jumps by close to π, because those come from crossing the center and would let back-and-forth motion cheat. Use Pointer Events so mouse and touch share the same code.