info = { type = "image", title = "Forest", category = "nature", author = "BRRRO", version = "1.0", license = "MIT", desc = "Pines in two layers and the sun", api = 33, } local LAYER = { { 6, 44, 0.70, 60, 128, 72 }, { 15.6, 58, 0.95, 40, 98, 54 }, } local BG function render() local W, H, FPS = gfx.W, gfx.H, gfx.FPS local rect, floor = gfx.rect, math.floor if not BG then for y = 0, H - 1 do local f = y / H rect(0, y, W, 1, 176 - 26 * f, 212 - 16 * f, 236 - 86 * f) end for dy = -3, 3 do local w = floor(math.sqrt(14 - dy * dy)) rect(12 - w, 8 + dy, 2 * w + 1, 1, 255, 240, 180) end BG = gfx.snapshot(0, 0, W, H) else gfx.blit_rgb(BG, 0, 0, W, H) end for l = 1, 2 do local L = LAYER[l] local by, sc = L[2], L[3] local cr, cg, cb = L[4], L[5], L[6] local shift = floor(frame * L[1] / FPS) % 13 for k = -1, 5 do local tx = k * 13 - shift for r = 0, 9 do local w = floor((r + 1) * sc + 0.5) rect(tx - w, by - 10 + r, 2 * w + 1, 1, cr, cg, cb) end rect(tx, by, 1, 4, 96, 66, 40) end end end