I'm newbie here, please help.
Game is with view from above (zero gravity), I need to throw/toss circle body with mouse (it's table from above and coins on it).
I already set up world, create mouse joint, but what I need is: not allow somehow to just drag and drop circle with mouse, instead need circle to be tossed; so if mouse is down and user just drags circle item instead of throwing it to destroy mouse joint (while mouseMove, not waiting to mouseUp), or give notice that it's wrong move etc. I just can't realized how to detect user is throwing object or just dragging it, it's something like to guess if user did fast swipe gesture or not.
I tried several options:
Record body.GetLinearVelocity().Length(); and compare this on every mouse move to detect if mouse is accelerated or not, didn't helped
Get mouseDown, mouseUp time and somehow prevent this time period exceed some value (hard to guess what value to set)
Check trajectory of mouse to check if user is just tossing circle linearly, but this also didn't helped much.
Can you suggest solution how to do this?
Thanks in advance 🙂
Game is with view from above (zero gravity), I need to throw/toss circle body with mouse (it's table from above and coins on it).
I already set up world, create mouse joint, but what I need is: not allow somehow to just drag and drop circle with mouse, instead need circle to be tossed; so if mouse is down and user just drags circle item instead of throwing it to destroy mouse joint (while mouseMove, not waiting to mouseUp), or give notice that it's wrong move etc. I just can't realized how to detect user is throwing object or just dragging it, it's something like to guess if user did fast swipe gesture or not.
I tried several options:
Record body.GetLinearVelocity().Length(); and compare this on every mouse move to detect if mouse is accelerated or not, didn't helped
Get mouseDown, mouseUp time and somehow prevent this time period exceed some value (hard to guess what value to set)
Check trajectory of mouse to check if user is just tossing circle linearly, but this also didn't helped much.
Can you suggest solution how to do this?
Thanks in advance 🙂