jumpinwater.lua - keep momentum when jumping into water!

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

Moderator: Userbase Moderators

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

jumpinwater.lua - keep momentum when jumping into water!

Postby Master of Disaster » Mon Feb 26, 2024 2:11 pm

I always hated how you lose all your speed when jumping into water.
So here's a handy little library that fixes that!

jumpinwater.lua v1.0

If you jump into water now, you'll keep your speed and gradually lose it over time instead of it getting nullified immediately.

You can customize how it works with these:
jumpinwater.keepSpeed = 0.4 -- How much of your speed will be kept when touching water. Wouldn't put it higher than 0.5 personally
jumpinwater.loseSpeed = 0.2 -- How much speed you lose per tick after falling into water.
jumpinwater.minKeepSpeed = 1 -- only if your vertical speed is higher than this, you'll keep vertical momentum. Makes jumping out of water easier

Some footage (tileset not included):
Spoiler: show
Before:
Image

After:
Image
Be as fresh as jumping into water on a summer day and credit me if you are using it.

And here is the download:
https://www.dropbox.com/scl/fi/lk5hz95a ... bg69c&dl=0

Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 3 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari