We see that in this case they use a separated color palette for the background so this will be solved with a very simple script tagged "layer_adjust"
function UpdateS() if shape2D.Palette == a then shape.Layer = 2; -- layer 2 else shape.Layer = 1; -- layer 1 end end
then tag all patterns that appears in multi layers with the same tag, try a value for a that works (from 0 to 3), there are just 4 palette for background
Or if that's true for the whole game so we can use this script with tag "*" without quote for the whole game
function UpdateS() if shape.Bg and shape2D.Palette == a then shape.Layer = 2; -- layer 2 else shape.Layer = 1; -- layer 1 end end