info = { type = "image", title = "Matrix", category = "patterns", author = "BRRRO", version = "1.0", license = "MIT", desc = "Digits falling from top to bottom", api = 33, } local COLS, ROWS = 11, 11 local TAIL = 38 local SPD = {} for c = 0, COLS - 1 do SPD[c] = 1.0 + (c % 4) * 0.44 end local STEP_HZ = 30 function render() local H = gfx.H local t = frame * STEP_HZ // gfx.FPS gfx.clear(26, 48, 32) local span = H + 30 local flip = t // 3 local text = gfx.text for c = 0, COLS - 1 do local x = c * 6 local head = (t * SPD[c] + (c * 53) % span) % span for yi = 0, ROWS - 1 do local y = yi * 6 local dd = head - y if dd >= 0 and dd <= TAIL then local ch = (c * 7 + yi * 13 + flip) % 2 == 1 and "1" or "0" if dd < 6 then text(x, y, ch, 220, 255, 210) else local f = 1 - dd / TAIL text(x, y, ch, 30 + f * 90, 110 + f * 130, 50 + f * 80) end end end end end