Nope, was just a straight adjustment to see how it looked. Would take a rework to put in acceleration/deceleration and I don't understand enough about the affects of gravity on an object with a fixed pivot point.
Did I mention the code is an ugly hack? Either way, here it is.
All code is in a button, only 1 grc on the screen so didn't bother to name it.
Code: Select all
local sRunning,sLastTime,sStartAngle,sEndAngle,sFactor,sDirection
on mouseUp
set the acceleratedrendering of this stack to true
if sRunning is empty then put false into sRunning
put 250 into sStartAngle
put 290 into sEndAngle
put (sEndAngle - sStartAngle) / 1000 into sFactor
put 1 into sDirection
put not sRunning into srunning
set the angle of grc 1 to 270
startPend
end mouseUp
command startPend
if sRunning then
if sLastTime is empty then put the milliseconds into sLastTime
put the milliseconds into tTime
set the angle of grc 1 to the angle of grc 1 + round((((tTime - sLastTime) * sFactor) * sDirection))
if the angle of grc 1 > sEndAngle then put -1 into sDirection
if the angle of grc 1 < sStartAngle then put 1 into sDirection
put tTime into sLastTime
if not lineoffset("startpend",the pendingmessages) then
send "startPend" to me in 15 milliseconds
end if
else
put empty into sLastTime
end if
end startPend
EDITED to fix the behavior some (emptying sLastTime)