# How do I: simple flight mechanics?

Get help using Construct 2

### » Thu Apr 02, 2015 11:44 am

Hello fellow constructors

After several years of lurking and toying with construct. i have come to ask you for some guidence/help.
I'm working on a flying game, like the good old Triplane Turmoil, and so far it's looking good.

But the issue I have is with the main flight mechanics.
I have tried several different ways, using behaviours and such - but they just don't really work.
Here is the game as it is now (A and D to drive, SPACE: Fire and CTRL: Bomb) : http://www.bardurm.com/game/index.html

And here is a video of Triplane Turmoil that i uploaded, showing the rather simple flight mechanics i'm looking for.. but perhaps with physics more up to date (Triplane has kind of pseudo physics) : https://youtu.be/dr9R874TluA

How would you guys do something like this? any ideas?

Kind regards
B
3
S
1
G
3
Posts: 4
Reputation: 1,033

### » Thu Apr 02, 2015 5:27 pm

You will have to do some kind of second-based (or tick-based) comparison scheme, comparing the previous plane position to the current plane position.

Like:
Every 1.0 seconds:
Set previousPlaneX = plane.X

Every tick:
if abs(plane.X - previousPlaneX) > 10
Set plane.Y to plane.Y + 10

That way the faster your plane moves across the screen (analogous to airspeed) the more lift it produces. Each second it will update the "previous" position and every tick it will compare it to the current position.

Chances are this exact scheme will be jerky at the exact instances in time when previousPlaneX = plane.X, so you will probably have to massage this scheme some to smooth it out.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
18
S
5
G
1
Posts: 1,192
Reputation: 4,164

### » Thu Apr 16, 2015 11:29 am

Thanks for the quick reply gumshoe2029

I´ve been way to busy lately, but I'll have a look at what you suggested an see if I can figure it out
but it does seem simple enough - but i'm a bit of a noob when it comes to this.
B
3
S
1
G
3
Posts: 4
Reputation: 1,033

### » Thu Apr 16, 2015 12:51 pm

Do you mind using the mouse as a direction pointer? Because then you could set the angle of the plane towards the position of the mouse and when pressing the D Button u slowly increase height.
B
12
S
3
Posts: 208
Reputation: 1,469