SMBX2 editor has Blocks-per-second calculator for converting blocks per second into pixels per frame for vanilla layer movement speed. The problem is that on attempt to make a crusher using looping vanilla SMBX events, with different up and down speed, just like classical layer operated crushers in SMW, and then running them for a long time (as long as actual normal level playtime) causes them to eventually desync and potentially wreck your level, something like this:
This problem occurs because of floating point imprecision. With faster speeds, imprecision can build up really quickly. For some reason even setting layer speeds to integer values still cause them to go off bounds over time. Only setting layer speeds to same value worked in loops, as I have seen in many SMBX1.3 levels.
Enter layerfix.lua. This script attempts to fix this issue by grid-snapping all blocks, BGOs and certain NPCs placed on layer every time vanilla SMBX event changes layer movement speed. If the script works properly looping events should never desync over time, just like this:
To install the fix, just load API in your level luna.lua file and that is it. Everything, including fetching all vanilla SMBX events that move layers, is automatically done from played level file.
DOWNLOAD