Programming the GP2X – Part 3: Mistakes Were Made

Tank game prototype on gp2xWell, I had not one, but two big mistakes in my code to calculate the trajectory of the bullets:

1) I had my GRAVITY constant defined as a negative (-9.8 m/sec^2), then I was subtracting it instead of adding it – so the bullet rose faster and faster!

2) The sin() and cos() functions were expecting angles in radians, and I was passing in degrees. That’s why everything got all crazy when I used an angle above 70.

    These are both resolved now, so the bullets actually go from here to there now. I can start doing some code cleanup before I move on to actually creating the explosions.

One Response to “Programming the GP2X – Part 3: Mistakes Were Made”

  1. Neolardo Va Dinci says:

    Good Boy!