I am making a game for a class and part of the game is set up such that the player runs around a planet and the camera follows the player. In other words, if you zoom out and keep the camera stationary, you will see the player running around a planet with his feet always pointing toward the center of the planet.
I want to make the player jump away from the planet and have "gravity" pull him back.
Currently the game is set up such that when you press the space bar it gives the player a y velocity and gravity pulls him back. This works fine for a normal platformer game but if you have the player at an angle the x and y coordinates change depending upon the angle. I'm also not sure how to give the player an initial velocity because that would also depend on the angle.
It was suggested to someone else in this forum to create a gravitational force that affects the player and another force that opposes the player to keep him on the surface of the planet. I don't know how to do that either.
Thanks!
Zach