is this possible? I’m looking to make a sprite follow a user drawn path whilst rotating to face the correct direction?
are there any books I can read to help learn Lua and the sdk? [import]uid: 68741 topic_id: 11144 reply_id: 311144[/import]
is this possible? I’m looking to make a sprite follow a user drawn path whilst rotating to face the correct direction?
are there any books I can read to help learn Lua and the sdk? [import]uid: 68741 topic_id: 11144 reply_id: 311144[/import]
I’m sure this is possible if you put all the path points into a Lua table and then create a for loop with a transition statement which basically tween’s between all the points creating the object moving along the path…
– Chris [import]uid: 33866 topic_id: 11144 reply_id: 40433[/import]
Hey there, as far as books go there are some coming, but not yet available - a great starting point is the sites below, the first is my own tutorial site the second is a list of tutorials from all over - all aimed at Lua/Corona 
http://Techority.com/
http://www.learningcorona.com/
Peach [import]uid: 52491 topic_id: 11144 reply_id: 40516[/import]
notts_forest_
This might help with what you’re trying to do:
http://developer.anscamobile.com/code/martian-control
It’s the source for Beebe Games Martian Control app and in the game the player draws a path that objects follow to get to a destination (which sounds almost exactly like what you’re trying to do). As far as facing the sprite in the direction of travel I would use an eventListener to get the position of the sprite and store it then get the next position and calculate the angle between the two points and then rotate the sprite to that angle. An example of this is used in the Ghost vs. Monsters template here:
http://developer.anscamobile.com/code/ghosts-vs-monsters
[import]uid: 27965 topic_id: 11144 reply_id: 40534[/import]
Also look at the Flight Control code.
https://github.com/ansca/Flight-Control
C [import]uid: 24 topic_id: 11144 reply_id: 40563[/import]