info = { type = "image", title = "Night", category = "space", author = "BRRRO", version = "1.0", license = "MIT", desc = "Night sky with twinkling stars", api = 33, } local N = 42 local SX, SY = nil, nil local BG function render() local W, H = gfx.W, gfx.H local t = frame / gfx.FPS if not SX then SX, SY = {}, {} for i = 0, N - 1 do SX[i], SY[i] = (i * 37 + 13) % W, (i * 53 + 7) % H end end if BG then gfx.blit_rgb(BG, 0, 0, W, H) else for y = 0, H - 1 do local f = y / H gfx.rect(0, y, W, 1, 72 + 52 * f, 94 + 52 * f, 156 + 50 * f) end BG = gfx.snapshot(0, 0, W, H) end local ph, sin, px = t * 6, math.sin, gfx.px for i = 0, N - 1 do if sin(ph + i) > 0.3 then px(SX[i], SY[i], 255, 255, 232) end end end