info = { type = "image", title = "Space", category = "space", author = "BRRRO", version = "1.0", license = "MIT", desc = "Stars and a ringed planet", api = 33, } local PX, PY = 46, 16 local HALF8, HALF6 = {}, {} for yy = -8, 8 do HALF8[yy] = math.floor(math.sqrt(64 - yy * yy)) end for yy = -6, 6 do HALF6[yy] = math.floor(math.sqrt(36 - yy * yy)) end local PASS = { { 10, 2.4, 150 }, { 14, 6, 210 }, { 10, 13.2, 255 } } local BG function render() local W, H = gfx.W, gfx.H local t = frame / gfx.FPS local rect, px, floor = gfx.rect, gfx.px, math.floor if BG then gfx.blit_rgb(BG, 0, 0, W, H) else for y = 0, H - 1 do local f = y / H rect(0, y, W, 1, 34 + 36 * f, 38 + 42 * f, 76 + 58 * f) end BG = gfx.snapshot(0, 0, W, H) end for p = 1, 3 do local P = PASS[p] local b = P[3] for i = 0, P[1] - 1 do px(floor((i * 53 + 11) - t * P[2]) % W, (i * 37 + 7) % H, b, b, b) end end for yy = -8, 8 do local h = HALF8[yy] rect(PX - h, PY + yy, 2 * h + 1, 1, 210, 150, 90) end for yy = -6, 6 do local h = HALF6[yy] rect(PX - h, PY + yy, 2 * h + 1, 1, 238, 196, 130) end for xx = -13, 13 do if xx < -7 or xx > 7 then px(PX + xx, PY + floor(xx * 0.34 + 0.5), 224, 224, 196) end end end