I had a change of plans. It's not x and y movement variables, but multiple movement/angle variables, and I'm having a hard time with this. I can't seem to figure out what to do in order to make code to do this, and I have little experience using trigonometry. Could someone please help me out?
I need to take something like this:
and then basically modify sonic's speed and angle based on his walking movement and angle so that he moves from the two movement and angle variables in the exact way he would move if I just set his location with the individual variables a bunch of times. The idea is to use sonic's falling movement and angle in order to get sonic to have an overall momentum and direction that every other movement and angle variable kind of *dump* into, enabling sonic to get boosts from gravity when he runs along a curve from falling and such.
This is, yes, very complicated, however the point is to make a total momentum physics engine that could possibly be used in more things than just sonic.
1 2 3 4 5 6 7 | int fmove= 5 ; //player's overall momentum double fface= 45 ; //player's ultimate direction of movement double wmove= 1.0 ; //speed player walks/runs forward int wface= 0 ; //angle player walks/runs forward double gmove= 1.0 ; //additional speed from gravity int gface= 90 ; //angle (direction) gravity is pulling you towards |