About jump physics, you can avoid the need to use fixed point math just for the Y axis if you use a table of precalculated increments, simulating the arc described by a second degree equation (the equation to calculate distance in a displacement with acceleration, i.e. gravity, is a second degree equation). Each frame during the jump (up and down) you add the value from the next index in the array instead of a fixed value.
You can calculate the arrays yourself, or you can use my simple (and terribly ugly and buggy) simulation program which outputs an array in C (which you can adapt to whatever). If you use windows, I can share it if you like.
Example of calculation: you input that the jump should reach 64 pixels high during 64 frames.
This is the output array for such a calculation:
Code: Select all
-3, -4, -4, -3, -4, -3, -3, -3, -3, -3, -2, -3, -2, -2, -3, -2,
-1, -2, -2, -1, -2, -1, -1, -1, -1, -1, 0, -1, 0, 0, -1, 0
1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 2,
3, 2, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 4, 3, 4
The output array contains increment for going up, then down (a complete parabola, from ground). If the index pointer gets past the array values (an extended fall, when the floor is lower than the platform you jumped from) you just repeat the last value until you hit the ground. It's not perfect, but it works fine and nobody will notice.
I myself use a complete fixed point system in my platform games 'cause I find it natural and new interactions are easily added (for example, a propeller which makes you float from the floor), but for the fighting game I'm coding for the compo, I didn't need something that complex. I'm using the precalculated increments array approach for that game and the physics feel great.
Give me a shout if you are interested.