2025-06-13 10:15:53 +07:00

41 lines
717 B
Lua

local module = {}
local myMath = require("modules.math")
local lastChange = 0
local amp = 50
local enabled = true
function module.onCreate()
lastChange = 0
end
local randoms = {
math.random(60, 140),
math.random(60, 140),
math.random(60, 140),
math.random(60, 140),
math.random(60, 140),
math.random(60, 140),
math.random(60, 140),
math.random(60, 140)
}
local realPositions = {
600,
679,
758,
837
}
function module.onUpdate(dt, elapsed)
if enabled then
for index, receptor in next, module.shared.receptors do
receptor.position.x = realPositions[index] + 50 * math.sin(elapsed / randoms[index])
end
end
end
return module