Does Corona have any sort of “Move To” functionality for objects at a constant speed? For example, you click somewhere on the screen (a listener is built in to sense where on the screen) and certain object(s) move to that point, assuming no other physical objects interfere with them.
A simple transition.to() routine, setting the object’s target X/Y value would seem to make sense. However, in my testing, this method presents two problems. First, since the transition library is time-based, the objects move to their target position slower or faster depending on the distance they are set to travel. Second problem, and more crucial, is that the objects involved in a transition seem to ignore physics, even if they’re set as physical bodies with dynamic behavior.
The first problem (varying “movement” speed) could probably be solved by using math… i.e. calculating the distance between the start X/Y and target X/Y, then adjusting the “time” parameter dynamically to ensure a basically consistent movement speed. I don’t see a packaged math function in Corona that calculates the distance between two points, but I’m sure it’s possible with some basic trigonometry (probably time to brush up on that stuff
)
The physics issue is more problematic. In my test environment, the user can select/deselect multiple objects, just like a typical strategy game might employ. Say there are 5 “soldiers” on the screen. The user can select any combination of them individually (and later with a drag-select box, I hope!). Then the user clicks on the screen to send them to that location. A transition.to() will send them there, but all physics are ignored until the transition is complete… in other words, the soldiers overlap each other as they reach near the target, then when they reach it, they sort of “bounce” away from each other because physics is restored at that point.
My ideal goal is to have the objects move near to the location clicked by the user. Since they are physical bodies, not meant to overlap, 5 of them obviously cannot occupy the exact same target location. I just want to send them roughly to that location… they can definitely end up in a little cluster or whatever, basically around that location, just not overlapping.
Any thoughts or ideas on this? Maybe this can generate some interesting solutions and concepts. 
Brent
[import]uid: 9747 topic_id: 2575 reply_id: 302575[/import]