Page 1 of 1

airshipScroll.lua (SMM-Like Airship Camera)

Posted: Fri Dec 03, 2021 6:48 pm
by Murphmario
This is a library that replicates the effect of an airship scrolling up and down seen in games such as Super Mario Bros. 3 and Super Mario Maker.
Image
Additionally, this has some values that should be applied to the level's .lua file. Listed here are the values plus their defaults:

Code: Select all

airshipScroll.sections = {0} --What sections the effect should be applied to. Note that this is a table.
airshipScroll.intensity = .01 --What speed should the effect should scroll at.
airshipScroll.movementLimit = 1 --How long should the effect should scroll for.
airshipScroll.movingLayer = "shipWater" --Whatever layer is here will scroll up and down with the screen, allowing you to have stuff like the water in SMB3's World 8-Ship.
NOTE: Doesn't work 100% the best with autoscroll.lua. Both libraries do work with one-another, but the screen might snap into position once it's done autoscrolling vertically. If anyone wants to fix this feel free.

Edit: Fixed an issue where "shipWater" misaligns if a section that has airship scrolling is disabled.

Download:
https://pastebin.com/7tZPVMpq

Re: airshipScroll.lua (SMM-Like Airship Camera)

Posted: Mon Dec 06, 2021 7:14 am
by MegaDood
This is great! I've always wanted to do airship levels with this effect and I'm so glad I now can.

Re: airshipScroll.lua (SMM-Like Airship Camera)

Posted: Sun Jan 02, 2022 1:29 am
by Murphmario
Quick update to this that fixes airshipScroll.movingLayer pausing when the player is powering up or down, thus desyncing it.

Re: airshipScroll.lua (SMM-Like Airship Camera)

Posted: Tue Jan 04, 2022 6:23 pm
by TheGameyFireBro105
Now 3-3 from SMB3 is fully possible in SMBX2!

Re: airshipScroll.lua (SMM-Like Airship Camera)

Posted: Wed Jan 05, 2022 1:03 am
by Sonya Sanchez
TheGameyFireBro105 wrote:
Tue Jan 04, 2022 6:23 pm
Now 3-3 from SMB3 is fully possible in SMBX2!
3-3 doesn’t use the airship camera?? The tiles just move up and down which was always possible by using layers and events since they got into smbx.

And no the background isn’t moving in the level it’s a illusion created by the background objects such as clouds and bushes that are also set on the layer to move up and down.

In short: 3-3 was always possible since the level never did the airship camera.

Re: airshipScroll.lua (SMM-Like Airship Camera)

Posted: Sat Apr 02, 2022 9:16 pm
by Chuchu370
How does this work, exactly?

Re: airshipScroll.lua (SMM-Like Airship Camera)

Posted: Sun May 29, 2022 9:27 pm
by VortexGX
Chuchu370 wrote:
Sat Apr 02, 2022 9:16 pm
How does this work, exactly?
I did in that in the local level .lua and it'll work as long as you have a layer named "shipWater"

Code: Select all

local airshipScroll = require("airshipScroll")
airshipScroll.sections = {1}

Re: airshipScroll.lua (SMM-Like Airship Camera)

Posted: Sun Aug 28, 2022 6:37 pm
by Cognition
I know this is a bit of an old post, but I do not have coder brain and need some help getting this to work. I dropped the downloaded file into the levels folder and changed what was needed but nothing has happened. Am I missing something and if so what? XD