I want to simulate a spinning top. I want the user to be able to click on the sketch, and give a good yank to the right to get the spinning going. Harder the yank, the greater the spin. Then, over time the spin will die down. If you click on the spinning top, then it stops.
The hard part, as I see it, is determining how hard the top has been spun. I guess I need to look at the delta between pmouseX and mouseX until there is a mouseup, and based on how far, over a short amount of time, the mouse has been flicked? As the user could click and hold for a long time before flicking, I am guessing I would need to have some threshold for mouseX movement to count towards the spinning action.
I am wondering if there is a project like this already out there?
1