Freefalling.lua - More Aerial Movement!

Share and discuss custom LunaLua code and content packs for SMBX2.

Moderator: Userbase Moderators

Master of Disaster
Swooper
Swooper
Posts: 67
Joined: Sun Nov 28, 2021 9:29 am
Flair: Average Koopa Fan
Pronouns: he/him

Freefalling.lua - More Aerial Movement!

Postby Master of Disaster » Mon Mar 27, 2023 5:53 am

----- Freefalling.lua v1.0 -----

It's a thing that was cooking up for a while now, but now I finally got around to release freefalling.lua!
Great for setpieces, hub levels and extreme verticality in general!

While you fall slower on default, hold down to dive down faster!! You can even break through blocks if you are fast enough!
You can also perform a fancy spin manouver by pressing run/altRun which gives you a little bit more time to dodge, speeds you up when diving and even defends you from enemies!

Start freefalling by touching an (invisble) freefall starter and stop by landing or touching an (invisible) freefall canceller.
Use Target Zones and Warning Zones to indicate where you should aim for and what you should avoid!
It also comes with a nice little npc, the Soarhatter (id:789)! Acts just like a springhatter but when you use it's spring, you start freefalling!

Here you can see some fancy freefalling!
Spoiler: show
Falling was never as fancy as now!
Image

You can even bounce off of enemies and springs!
Image

Do the Barrel Roll! Avoid dodgy situations
Image

Spinning can even defeat enemies!
Image

What using your head looks like:
Image

Cool dodge manouvers, helped by the Target and Warning Areas!
Image
Editor options:
Spoiler: show
When placing a freefall starter (invisible ingame), you can configure how the freefalling works:
Starting Speed: the speed the player needs to accelerate to until they start freefalling. If 0, you will start freefalling as soon as you leave the ground
Keep Active: If ticked, the player can start freefalling after stopping the freefall again. If not, the player only starts freefalling once.
Fall Damage: the speed the player has to have to take damage when landing on the ground. If 0, there is no fall damage.

When placing a freefall canceller (invisible ingame), you can configurate one option:
Stop for good: If ticked, the player will not be able to get into freefalling afterwards. If not, the player can reenter freefalling when not in this zone

stuff you can use on your own to change how freefalling works:
freefalling.freefall = false, -- makes the player start/stop freefalling
freefalling.falldamage = 0, -- the vertical speed the player needs to be damaged on landing (0 if you don't want that)
freefalling.keepactive = false, -- if the player is able to start freefalling again after landing (without having to find another freefall starter)
freefalling.touched = false, -- if the player touched a freefall starter; when touched, it keeps on true until the player starts freefalling
freefalling.startspeed = 0, -- the speed the player needs to start freefalling. If set to 0, you are always in freefalling mode when in air
freefalling.cancelled = false, -- whether the player touched a freefalling canceller. If true, cancels the freefalling by doing a flip
freefalling.dynamicCam = true, -- Whether the Camera zooms in and out dynamically. You can set it to false to have the camera be static
Can be performed with all (vanilla) characters, though the current spritesheet only has graphics for Mario, Luigi and Toad in the SMW style.

This library uses customCamera.lua by MDA. If you don't want customCamera support (for... some reason), rename the raw version of freefalling.lua into freefalling.lua and do whatever you think is right with the objectively better version.
Do the same for the Target and Warning Areas.
The tileset used in the level was made by UnderFlo.

Be cool and credit me if you use this library, thanks in advance!

How to use:
Copy freefalling.lua and the files for block-800 to block-803 into your episode/level folder. Enter freefalling = require("freefalling") in your luna.lua file and place down a freefalling starter. If you touch it now, you'll start freefalling!
(blocks 802 and 803 as well as npc-789 are optional, but a cool thing to have)

Interested? Here's the download!
https://www.dropbox.com/sh/xuzjmwh7hf1g ... UKp8a?dl=0

Pixelated_Perfection
Bot
Bot
Posts: 57
Joined: Fri Feb 25, 2022 1:23 pm
Pronouns: She/They

Re: Freefalling.lua - More Aerial Movement!

Postby Pixelated_Perfection » Mon Mar 27, 2023 6:01 am

Seeing as somebody has to do the joke.


MegaDood
Charged Spiny
Charged Spiny
Posts: 1831
Joined: Wed Nov 01, 2017 2:43 am

Re: Freefalling.lua - More Aerial Movement!

Postby MegaDood » Mon Mar 27, 2023 6:29 am

Awesome to see this finally released! I've been following your progress on it for some time now, and I love how far it's come. Nice work! You should be proud!

ilovehamburgerz
2025 Egg Hunter
2025 Egg Hunter
Posts: 470
Joined: Thu Jul 25, 2024 5:34 am
Flair: i have 0 dollars
Pronouns: he/him

Re: Freefalling.lua - More Aerial Movement!

Postby ilovehamburgerz » Sun Oct 20, 2024 2:33 pm

holy crap thanks i can use this for my fortnite epsiode!!1!!1!!

Pjerun
Shy Guy
Shy Guy
Posts: 8
Joined: Sat Jun 25, 2022 4:58 am
Flair: SMBX Enjoyer
Pronouns: any
Contact:

Re: Freefalling.lua - More Aerial Movement!

Postby Pjerun » Mon May 12, 2025 3:51 pm

Kratos fall moment


Return to “LunaLua”

Who is online

Users browsing this forum: Rodriv64 and 3 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari