Right now I’m working on a small platform game in which the player is a sphere rolling around the surfaces of moons. To make the player jump, I’m currently calling:
player.touchJoint.frequency = 0.3;
player:setLinearVelocity(250*math.cos(player.angle - math.pi/5), 250*math.sin(player.angle - math.pi/5));
This works as intended on the first moon, however, since the radii of the moons are not all the same, the radial gravities are not all the same, so on the larger moons the player makes smaller jumps and on the smaller moons the player makes larger jumps.
I’m not sure how to create a sense of standardized gravity while maintaining the effect of the center-seeking forces acting on the player.
What kind of formula can I apply to the frequency to make this happen? I’ve done some trial and error but my results aren’t very good and I can’t find a consistent formula to attach to the frequency to make it appear that the gravity acting on the player is the same no matter what the radius of the field acting on them is.
Thanks in advance!
EDIT: If it helps, here’s an image of a level used in the game.