Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Need some help applying basic physics to a 2d environment.

  1. Feb 4, 2007 #1
    Could someone help me understand the principles behind a few things in physics? I'm trying to build a little side-scrolling space game where you can bolt add-ons and engines to your ship. Each has its own mass (and in the case of engines, their own maximum thrust), and therefore affects the handling of the ship.

    The downer is, I suck at physics. So explanations using notation usually make no sense to me.

    Also, ultimately I'm interested in retreiving variables that are useful in a 2d-world. I need to be able to handle formulae in such a way that when each frame is redrawn, I don't just know the various amounts of torque or inertia that are affecting the ship, but also what basic effect they'll have in 2d. How much is it going to move on the X/Y axes, how much will it rotate by, and around what point?

    Fortunately, the only ship which needs to be physics-enabled is the player's ship. Everthing else will be much simpler, such as enemy vessels.

    Unfortunately, I'm not using a very common programming language, so I can't just reference a pre-existing library or find a tutorial.

    Anyway, what I'm hoping to achieve physics-wise is:

    The effect where adding different mountings, such as a big gun on the top, will adversely affect the control of the vehicle. So the total mass (and the thrust capabilities of the engines) of the ship will affect its overall performance in terms of acc/decceleration/etc.

    But also, the elements of twist on the main body as a result of the additional components. For example, if you have two engines on the underside fighting gravity, and one is destroyed, gravity will pull down one end while the remaining engine lifts the other. The result (I believe) would be a rotation.

    Similarly with the positions of the different mounted units. A large gun on the top of the ship may cause it to flip if you brake too suddenly.

    Could somebody help me do this please?:smile:
    Last edited: Feb 4, 2007
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?