I've attached a stack based upon my old game stack (and have commented out a bunch of irrelevant script for this particular example). Click on the four buttons to "release" them. Click on them to stop them. You'll see how the speed of the moving buttons drops dramatically as more are put into motion and speeds up as you stop them, one-by-one.
I think I'll try your code with more moving objects to see what happens there.
Funny thing: I seem to remember my stack being so much smoother when all my objects (eight or so) were moving (on Core2Duo Macs). Maybe your code will result in smother moving objects.
Thanks for all the ideas!
Regards,
Barry
[-hh] wrote: ↑Tue Feb 13, 2018 3:13 amThe move command can be easy: Here is just another option to show this.rumplestskin wrote:The move command would have been so easy.
Script your card with the following, no script in the moving graphic. Start with a click on the (stopped) graphic.
Code: Select all
local gotcha=true on moveIt -- if "moveIt" is in the pendingmessages then exit moveIt -- for testing if (the shiftkey is down and the cmdkey is down) then put true into gotcha if gotcha then exit moveIt move graphic "theGold" to (457,90),(0,90),(457,90) in 4 seconds without waiting send "moveIt" to me in 4 seconds -- put the pending messages -- for testing end moveIt on mouseDown if not gotcha and the clickloc is within the rect of grc "theGold" then put true into gotcha move graphic "theGold" to (the clickH,90) -- stops moving answer "Ya got me, pardner!" end if end mouseDown on mouseUp if gotcha and the short name of target is "theGold" then put false into gotcha set loc of grc "theGold" to (457,90) send "moveIt" to me in 1 tick -- start move end if end mouseUp