1
\$\begingroup\$

I am making an Asteroids clone and I want to implement proper physics for the objects. What equations would I use to calculate the acceleration? For example, I have a ship, and it might have properties like mass and other stuff (whatever might be relevant, I don't know). If I assume thrust of 10 units, how would the ship accelerate over time in the given direction? There is no friction since the game is set in space, so I don't need to worry about deceleration.

When I Google formula for acceleration, it says final velocity - starting velocity / elapsed time but that's for calculating how much an already accelerating object is accelerating by isn't it? Or am I confused? Thanks for helping.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ This is just grade 9 algebra to rearrange that equation to solve for final velocity, given starting velocity and your time step. \$\endgroup\$
    – DMGregory
    Jun 29, 2021 at 21:13
  • \$\begingroup\$ @DMGregory Ah, thanks. So that gives final = acc * time + starting. So the I have time and starting. Would I choose and arbitrary value for acceleration or would that depend of the physical system ? \$\endgroup\$ Jun 29, 2021 at 21:18
  • 1
    \$\begingroup\$ What does Wikipedia have to say about unit conventions for acceleration? \$\endgroup\$
    – DMGregory
    Jun 29, 2021 at 21:28

1 Answer 1

1
\$\begingroup\$

I found that newtons second law of motion was what I was looking for.

Force = Mass * Acceleration.

Rearranging this gives us the acceleration.

Acceleration = Force / Mass

Then I am adding this amount to my objects velocity vector every frame.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .