41 lines
718 B
Lua
41 lines
718 B
Lua
local module = {}
|
|
|
|
local myMath = require("modules.math")
|
|
|
|
local lastChange = 0
|
|
|
|
local amp = 50
|
|
|
|
local enabled = false
|
|
|
|
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 |