
This script lets you define layers that move according to a sine wave without having to write lua or configure events.
It's a product of my own laziness and uses the layer name as the definition for the wave motion.
To use this script, load it in your luna.lua and name your layers according to the specification.
local sinelayers = require("sinelayers")
https://pastebin.com/0ZKuBXJa
-- Examples:
-- sinea8f1x10y10d8 -- Y-Sway amplitude of 8 (* 8), frequency of 1 (second), x-movement of 10 (blocks right), y-movement of 10 blocks (down), over the course of 8 (seconds)
-- sinea0f1x-3y-8d1 -- No sway. Move 3 blocks left and 8 blocks up within one second.
-- Explanation:
-- The layer gets 2 sine motions applied. A constant y-sway, and a separate x/y movement motion. The former is controlled by a, f. The latter by x, y, d
-- sinea <- identifier
-- a[num] <- amplitude of the constant y-swaying motion, in quarter-blocks (pixels * 8)
-- f[num] <- frequency of the constant y-swaying motion, in seconds
-- x[num] <- horizontal distance travelled during movement motion, in blocks (pixels * 32)
-- y[num] <- vertical distance travelled during movement motion, in blocks (pixels * 32)
-- d[num] <- frequency (duration) of the movement motion, in seconds