info = { type = "image", title = "Rocket", category = "space", author = "BRRRO", version = "1.0", license = "MIT", desc = "A rocket lifts off with flame and smoke", api = 33, } local SPR = { "..HH..", "..RR..", ".RWWR.", ".RWWR.", ".RWWR.", "RRWWRR", "R.WW.R" } local SCOL = { H = {232,72,60}, R = {206,60,54}, W = {236,238,248} } local BG function render() local W, H = gfx.W, gfx.H local t = frame / gfx.FPS local px, floor, sin = gfx.px, math.floor, math.sin 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, 60 + 90 * f, 120 + 70 * f, 210 + 28 * f) end BG = gfx.snapshot(0, 0, W, H) end local phase = floor((t % 3) * 30) local rx = 9 + (floor(t / 3) * 29) % 46 local ry = 52 - phase for r = 1, 7 do local row = SPR[r] for c = 1, 6 do local ch = row:sub(c, c) if ch ~= "." then local col = SCOL[ch] px(rx - 4 + c, ry + r - 1, col[1], col[2], col[3]) end end end for i = 0, 23 do local ph = (t * 36 + i * 3) % 14 local sw = 3 - ph * 0.2 if sw < 1 then sw = 1 end local y = (ry + 7 + ph) // 1 if y >= 0 and y < H then local x = rx + floor(sin(i * 2.0 + t * 18) * sw + 0.5) if ph < 5.6 then px(x, y, 255, 235, 120) else px(x, y, 255, 150, 50) end end end for i = 0, 9 do local x = rx + (i < 5 and -1 or 1) * (4 + ((t * 18 + i * 4) % 14) // 1) local y = ((ry + 9) - (t * 12 + i * 3) % 6) // 1 if y >= 0 and y < H then px(x, y, 220, 224, 234) end end end