# Calculate spaceship's movement

## Recommended Posts

PhilObyte    486

Hello,

I am currently developing a prototype of a 2d game where the user can built his own spaceships with tiles.

The player also places the jets which give him thrust to move and steer it.

In order to do that, the velocity and rotationVelocity must be calculated.

Unfortunately I do not know very much about physics. How can I do this?

Known properties of a ship:

-Velocity

-center of gravity

-weight

I hope my goal is not too ambitious Thanks in advance, Phil.

##### Share on other sites
rip-off    10976

Have you considered using a physics library?

##### Share on other sites
PhilObyte    486

Have you considered using a physics library?

If there is any way to do it without one, I would like to make it by myself since I had to understand the whole library.

##### Share on other sites
Bacterius    13165

Have you considered using a physics library?

If there is any way to do it without one, I would like to make it by myself since I had to understand the whole library.

That's not really a good argument towards not using a library. Now without the library you're going to need to learn mechanical physics and rotational physics. If you're keen to, then sure, it's a good learning experience, but if you just want to finish a game, using a physics library is probably a smart move.

##### Share on other sites
PhilObyte    486

It would be really nice to learn how this works, if it is not too complicated. I looked for it on the Internet, but no tutorial was suitable to me.

##### Share on other sites
landagen    376

In 2D it may not be as complicated.  That does help.  I presume you are in space so this will also help.  The general steps to solving a physics problem is this:

1.  Identify all forces and velocities (in vector form)

2.  Determine how to apply those forces to your object

3.  Sum the forces up in each direction.  Any extra force components on an object get translated into acceleration based on mass.

If you have to deal with impact forces, that can get a little more complicated.  You will have to read and learn each of the individual equations you will need yourself because it is too much material to cover in a forum.

##### Share on other sites
PhilObyte    486

In 2D it may not be as complicated.  That does help.  I presume you are in space so this will also help.  The general steps to solving a physics problem is this:

1.  Identify all forces and velocities (in vector form)

2.  Determine how to apply those forces to your object

3.  Sum the forces up in each direction.  Any extra force components on an object get translated into acceleration based on mass.

If you have to deal with impact forces, that can get a little more complicated.  You will have to read and learn each of the individual equations you will need yourself because it is too much material to cover in a forum.

Thank you very much. I think this will do it for the prototype, without rotational force. I can implement that later.