Quantcast
Viewing all articles
Browse latest Browse all 2939

LunaLua • easyliquids.lua - Flood your levels with code!

Have you ever made a level with water or lava and thought: "man, placing these things sure is tiring, huh". Well, fear not, because we're in the future and LunaLua can do that just for you!

easyliquids.lua is a library made to easily fill sections with water or lava, but it also provides some advanced features to customize them and make them move in funny and convenient ways! Here's an example:

code: show

Code:

local easyliquids = require("easyliquids")easyliquids.levelLiquids = {    [0] = {        liquidtype = easyliquids.TYPE_WATER,        height = 40,        targetheight = 90,        goback = true,        waittime = 1    },    [1] = {        liquidtype = easyliquids.TYPE_LAVA,        blockheight = 2,        targetblockheight = 4,        easing = easyliquids.EASING_INOUTSINE,        goback = true,        movetime = 2    }}
Image may be NSFW.
Clik here to view.
Image


To use the library, unzip the easyliquids.zip file into your custom level folder. Then, create a luna.lua file (if you haven’t already made one) and insert this line of code:

Code:

local easyliquids = require("easyliquids")
NOTE: The library is only compatible with SMBX2 Beta 5.

NOTE: By default, the library uses the SMM2 styled water included in the zip file. If you don’t need it, you can avoid copying the image file to your level folder.

NOTE: If you’re using respawnRooms.lua, add this code to your luna.lua file to make the library work properly on respawn:

Code:

function respawnrooms.onPostReset(fromRespawn)    easyliquids.initLiquids()end
Here you can find some proper explanation of every feature, with some more examples:
Documentation

Finally, here's the download:
Download

Statistics: Posted by Akromaly — Sun Feb 18, 2024 1:51 pm



Viewing all articles
Browse latest Browse all 2939

Trending Articles