I’m programming a game like puzzle bobble, with a beam showing where we are pointing. The problem is when the player is going to lift finger and almost always exist a small sliding movement.
Some idea?
Thanks 
I’m programming a game like puzzle bobble, with a beam showing where we are pointing. The problem is when the player is going to lift finger and almost always exist a small sliding movement.
Some idea?
Thanks 
Is the action to be performed the same whether the finger is lifted or slides? If so you can do: if event.phase == “moved” or event.phase == “ended”
Player has to click over main character and slide backward, calculating direction/trajectory for the next shot. When player decides that has aimed well, has to lift up finger and “here” comes the problem…
While player is lifting the finger, still stays for awhile in moved phase because usually a person not lift a finger without do any slide, and it modifies the final trajectory.
Perhaps you should take a look at this sample code: http://developer.coronalabs.com/code/ghosts-vs-monsters
The game looks really cool :D but the most important for me now is analyze the code to look for some solution
thanks
In the example project use almost the same formula than me, to calculate angle between two points.
Mine: local ang = -( atan2 ( incx, incy ) * 180 / math.pi - 180 )
Example: local ang = atan2 ( incy, incx ) * 180 / pi + 90
Why i have been using minus (-) and then -180 instead of + 90 directly? i don’t know xD i suppose that when i was looking for the formula i found that. But the most curious thing is that testing both formulas, the second (from the example) seems to work better…
Also, in the example, use math.ceil to round and thanks to it the aiming process is a bit less sensible, good for me.
I’ll test more depth tomorrow.
Is the action to be performed the same whether the finger is lifted or slides? If so you can do: if event.phase == “moved” or event.phase == “ended”
Player has to click over main character and slide backward, calculating direction/trajectory for the next shot. When player decides that has aimed well, has to lift up finger and “here” comes the problem…
While player is lifting the finger, still stays for awhile in moved phase because usually a person not lift a finger without do any slide, and it modifies the final trajectory.
Perhaps you should take a look at this sample code: http://developer.coronalabs.com/code/ghosts-vs-monsters
The game looks really cool :D but the most important for me now is analyze the code to look for some solution
thanks
In the example project use almost the same formula than me, to calculate angle between two points.
Mine: local ang = -( atan2 ( incx, incy ) * 180 / math.pi - 180 )
Example: local ang = atan2 ( incy, incx ) * 180 / pi + 90
Why i have been using minus (-) and then -180 instead of + 90 directly? i don’t know xD i suppose that when i was looking for the formula i found that. But the most curious thing is that testing both formulas, the second (from the example) seems to work better…
Also, in the example, use math.ceil to round and thanks to it the aiming process is a bit less sensible, good for me.
I’ll test more depth tomorrow.