Flight Model

Regular (ha!) updates on the latest development progress

Flight Model

Postby stormclouds » Thu Apr 26, 2012 11:37 am

The flight model for this game is reasonably complete now, I'm happy to stick with what I have (with perhaps some fine tuning).

I did try applying the basic forces of lift, thrust, gravity & drag (see this ground school webpage for some excellent information), but in the end found it too complex for a simple 2D game.

So I scrapped the above, and started with a simple equation:

Code: Select all
Vector2 vector = new Vector2()
{
    X = (float)Math.Sin(Angle),
    Y = (float)Math.Cos(Angle)
};

return (Vector2.Normalize(vector) * Speed);


This gives me a movement vector, given the plan's angle & speed. Next, after adding code to reduce speed when flying up, gain speed when flying down, stalling, low speed flight and some ground handling, I got this:



Its a bit jerky, due to fraps (maybe I need a faster machine?) Anyway, the game is not jerky when playing.

By the way, my youtube channel is 2DFlightSim, I'll be adding more dev blog videos here soon.
stormclouds
Site Admin
 
Posts: 84
Joined: Tue Apr 24, 2012 8:23 am

Return to Dev Blog

Who is online

Users browsing this forum: No registered users and 6 guests