writing an autopilot for a 2d game with newtonian physics

Posted by Jargo on Game Development See other posts from Game Development or by Jargo
Published on 2012-11-07T19:13:39Z Indexed on 2012/11/07 23:15 UTC
Read the original article Hit count: 194

Filed under:

The subject says it all. I am making a 2d space game with newtonian physics and I need pointers on how to write an autopilot for it. The requirements are best explained by an example.

There is a target object which has speed- and position-vectors and there a spaceship that is controlled by the autopilot. This spaceship also have speed, position and maximum acceleration. The autopilot needs to control the ship that it either collides with the target, Or intercepts the target so that the ship has matching speed and position with the target.

Could someone give me some pointers how to achieve this behavior or perhaps even an ready implementation? I am sure someone has written something like this before and there is no point in reinventing the wheel.

© Game Development or respective owner

Related posts about 2d-physics