info = { type = "image", title = "Rainy", category = "nature", author = "BRRRO", version = "1.0", license = "MIT", desc = "Rain and ripples on a puddle", api = 33, } local WY = 57 local COS, SIN = {}, {} for a = 0, 17 do COS[a] = math.cos(a * 0.36) SIN[a] = math.sin(a * 0.36) * 0.3 end local BG function render() local W, H, FPS = gfx.W, gfx.H, gfx.FPS local t = frame / FPS local floor = math.floor 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, 98 + 54 * f, 110 + 54 * f, 138 + 52 * f) end BG = gfx.snapshot(0, 0, W, H) end for i = 0, 41 do local y = (i * 53 + t * 90) % (H + 10) - 5 local y0 = y > 0 and y or 0 local y1 = y + 2 if y1 > H - 1 then y1 = H - 1 end if y1 >= y0 then gfx.rect((i * 37 + 11) % W, y0, 1, y1 - y0 + 1, 206, 218, 240) end end gfx.rect(0, WY, W, H - WY, 72, 86, 114) for r = 0, 2 do local cx = 10 + r * 22 local rad = floor((t * 18 + r * 7) % 13) for a = 0, 17 do local x = cx + floor(COS[a] * rad + 0.5) local y = 59 + floor(SIN[a] * rad + 0.5) if x >= 0 and x < W and y >= WY and y < H then gfx.px(x, y, 156, 176, 206) end end end end