Hi all! 
I am trying to make a game where red player jumps towards target (blue color).
You can see attached screenshot here:
https://www.dropbox.com/s/3hm2f6yifjlvz8x/Game.png?dl=0
In this sketch player uses 3 jumps in total, but that could be 4-5-6-7 jumps depending on a distance between them. Red circles with white color are just points where player would jump (just for illustration).
So far I have this code:
local player = display.newCircle( 0, 0, 25 ) player:setFillColor(1, 1, 1) player.x = screenWidth\*0.1 player.y = math.random(screenHeight\*0.25, screenHeight\*0.85) player.isFixedRotation = true local blueTarget = display.newCircle( 0, 0, 25 ) blueTarget:setFillColor(1, 1, 1) blueTarget.x = screenWidth\*0.8 blueTarget.y = math.random(screenHeight\*0.25, screenHeight\*0.85) blueTarget.isFixedRotation = true function jumpPlayer() local jumpTime = 500 transition.to ( player, { time = jumpTime, x = player.x + player.width\*2 } ) transition.to ( player, { time = jumpTime/2, y=player.y - player.height\*2, transition = easing.outQuad, onComplete = function() transition.to ( player, {time = jumpTime/2, y = player.y - player.height, transition = easing.inQuad }) end } ) end
I can calculate distance between red circle and blue circle like this:
local distance = math.sqrt ( (blueTarget.x - player.x)^2 + (blueTarget.y - player.y)^2)
I can calculate direction like this:
local deltaX = blueTarget.x - player.x local deltaY = blueTarget.y - player.y local Direction = math.atan2(deltaY, deltaX) \* 180 / math.pi
Can you please help me how to accomplish these jumps?
These jumps are not controlled by people who play the game, jumps should be “guided” like missile! 
Waiting your reply!!
Thanks!
G
