local words = {
"banana", "castle", "fire", "ocean", "dream", "pizza", "rocket", "jungle",
"echo", "storm", "silver", "magic", "robot", "noodle", "cosmic", "whisper",
"thunder", "velvet", "tornado", "galaxy", "mango", "crystal", "shadow"
}
local wordTimer = 0 -- tracks time until next word
local colorPhase = 0 -- drives the rainbow cycle
function onCreate()
end
function onUpdate(dt)
-- Every 3 seconds, pick a random word and append it
wordTimer = wordTimer + dt
if wordTimer >= 3 then
wordTimer = wordTimer - 3
local word = words[math.random(#words)]
my.text.content = my.text.content .. " " .. word
end
-- Cycle rainbow color using sine waves offset by 120 degrees each
colorPhase = colorPhase + dt
local r = math.sin(colorPhase * 1.5) * 0.5 + 0.5
local g = math.sin(colorPhase * 1.5 + 2.094) * 0.5 + 0.5
local b = math.sin(colorPhase * 1.5 + 4.189) * 0.5 + 0.5
my.text.color = { r = r, g = g, b = b, a = 1 }
end
function onMessage(message, triggeri