How do I: simple flight mechanics?

0 favourites
  • 4 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • 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

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)