2024/11/17

How to use the 'Superflight" addon in gDevelop?

It is an extension that I created for gDevelop. In this article, I will explain how to use it.
Do not worry about the text around this blog with an alien language, you will not need any other pages here, I promise.

After you installed the extension, you can apply a new "Flight ability" behaviour to any object. Activating it will immediately make the object fly. (in the figure below, I have already added it, that's why it is grayed out)

You can find the ability on the "Behaviours" page

After this, you can use the "Fly up", "Fly down", "Fly to left", and "Fly to right" to make movements in the air.

This addon is very configurable. On the behaviour settings page, you can find all of the options to fine-tune your experiment, or you can do it by usign actions. You can adjust:
    ¤Horizontal acceleration/deceleration
    ¤Vertical acceleration/deceleration
    ¤Maximum horizontal speed
    ¤Maximum vertical speed
    ¤Jump-up ability and its speed
    ¤Bobbing ability and its speed, and magnitude
    ¤And the motion cutoff value, which you can find in the advanced section of the settings page. I don't recommend fiddling-diddling-riddling with it too much.

The jump-up ability adds a tiny detail. When the behaviour is enabled, then the object jumps up a little bit, kind of like a warm-up.
And the bobbing is another tiny detail. If the object is not flying to anywhere (complete stop), then it makes a continuous small up-down movement (in a sinusoidal pattern, with the function sin(t*b)*a, where t=time; b=speed, a=magnitude).
WARNING: the acceleration/deceleration and jump-up speed are reciprocal, meaning the larger the input number is, the smaller the effect will be.

Appendix:
    All actions:
        ¤FlyLeft
        ¤FlyRight
        ¤FlyUp
        ¤FlyDown
        ¤SetMaxXspeed
        ¤SetMaxYspeed
        ¤SetJumpUpSpeed
        ¤SetJumpUpAbility
        ¤SetBobbingDistance
        ¤SetBobbingSpeed
        ¤SetBobbingAbility
        ¤SetSpeedCutoffValue
    All conditions:
        ¤Moving?
        ¤Bobbing?
        ¤CanBob?
        ¤JumpUpAtStart?
    All expressions accessible within the "Expression Builder":
        ¤FlightYdir
        ¤FlightXdir
        ¤FlightXacc
        ¤FlightYacc
        ¤FlightMaxXspeed
        ¤FlightMaxYspeed
        ¤BobDist
        ¤BobSpeed
        ¤MotionCutoff
        ¤StartJumpUpSpeed