Hi, i am trying to make a game where you have to collect thing while you are floating in space.
the idea is to a jetpack that thrust you in the opposite direction to where you tapped. just like satellite does to correct their trajectory. see the image attached. I have drawn only three options but the idea is that no matter where you tap the object moves in the opposite direction, not only up and down , left and right. but 360 degrees around the object.
at the moment i am doing this, which is not far off, but I want every direction not just 4? plus this one has a problem that can be two things at the same time
if x \< groupAstronaut.x then moveX=moveX+10 else moveX=moveX-10 end if y\< groupAstronaut.y then moveY=moveY+10 else moveY=moveY-10 end end groupAstronaut:setLinearVelocity(moveX, moveY)
also i want the object to rotate in that direction so I need somehow calculate the angle between the object and the tap and make the object rotate to that angle.
Anybody has any ideas?
Thanks.