I wonder if someone could possibly help with the physics side of a game I'm considering.
It's a sidescrolling Sh'mup. The objective is to carry out various missions in return for cash. Using the cash you can buy various kinds of chassis. Each chassis has mounting points available where you can bolt on different add-ons, like engines, guns, etc (you can have mounting points on the side of the ship, and mounting points on the top/bottom/front/back of the ship as well, depending on chassis).
Each possible add-on has a mass - and if it's an engine, it has thrust as well.
Ideally I want to bind these to the physics as much as possible. So bolting on very heavy guns will impair the acc/decceleration, and may require new up-thrust engines to counteract the weight.
If possible, I'd also like to be able to have moments of inertia (or whatever you call them). For example, having a heavy gun at the top will make the top want to lift if you brake too hard.
Could anyone help out with the formulae and application for this?
I'm gunna be really unhelpful at the moment and just say:
As far as the application goes, store everything such as deceleration and weights etc. into global values / variables instead of setting them to separate values each time. so you can add to and take from each value in loops etc. when movement (weight vs speed etc) is concerned
Heh, I dunno. Maybe you could just tilt the ship depending on each add-on's position compared to the ship's hot-spot (or if you want to complicate things: its center of mass). Like, fastloop through all add-ons, compare their X and Y position with the ship's hot-spot, sum it up and divide it by something to get a nice small value, and add it to the ship's rotation angle.
I don't know if that made any sense, but at least I tried
Well, if you still need help, you can mail me. Hmm... I think you did, lol, or was it someone else. But one thing is clear though... rotation is a b*tch, especially with MMF's engine. I could probably do the engine for you, but I want some payment for my time .
I kinda forgot the formulae for it too... I had a nice functional physics engine, but never released it on the net because I was too lazy to make examples. Heck, I also have a nice, functional programming language engine I finished last week but didn't release it for the same reason.
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.