The nature of my problem is this. I'm trying to make a side-view shooter, basically a clone of the BBC micro classic Thrust from the 1980s. I've managed to make the ship turn in 360 directions by using alterable values and basic trigonometry. I've set the following into alterable values:
- The virtual X coordinate of the ship. Has a range of 0-640,000 for accuracy. The X coordinate of the ship is set to this divided by 1000.
- The virtual Y coordinate of the ship. Basically same as above.
- The X vector of the ship which is added to the virtual X coordinate every 1/100s
- The Y vector - ditto
- The direction of the ship in degrees. The 32-direction direction of the ship is set to this value /11.25 every 1/100s.
I can make gravity and thrust work fine with these figures.
My big problem is what to do when the ship is attached by a line to another object, the load. I need to work out how to code the drag of the load and factor it into the ship's X and Y vectors. It may have something to do with finding centres of gravity and adding vectors, but I'm not sure.
I'm sorry if I'm not very clear about what I need, but if you've played Thrust you'll know what I mean. Here's a link to a freebie PC clone of the game (< 1MB)which might illustrate my point better.