fx.module
README.md
fx
Paints the twoDKit's effect and pickup sprite sheets and saves them to art/fx/ as nearest-filtered textures with sprite-shader materials. Run it again whenever the art code changes.
local FX = require("twoDKit.artgen.fx")
FX.generate() -- saves art/fx/fx and art/fx/checkpoint (+ materials)
local fxSheet, cp = FX.paint() -- canvases only, for previews
local gem = FX.fxRows.gem -- { row = 5, frames = 6 }
All pixels are fully opaque or fully clear, as the alpha-cut sprite shader needs. Fades happen by puffs splitting, shrinking and dimming, never by partial alpha.
fx: 128x128, 16x16 frames, 8 columns
Identity: twoDKit.art.fx.fx. Rows are numbered from the top, starting at 0.
| Row | Name (fxRows) | Frames | What |
|---|---|---|---|
| 0 | dust | 6 | Small grey-white puff that grows, splits and fades (run and jump dust). |
| 1 | land | 6 | Landing burst: two puffs spreading left and right along the ground, anchored on the bottom row. |
| 2 | sparkle | 4 | Collect twinkle: a star that flares, then scatters glints. |
| 3 | dash | 4 | Dash ring with trailing wind streaks, pointing right; flip it for a left dash. |
| 4 | wallKick | 4 | Wall-jump kick dust; the wall is on the right edge, so flip it for a wall on the left. |
| 5 | gem | 6 | Collectible gem spinning: a faceted cyan and magenta crystal about 10x12, bottom at y=13. |
| 6 | goal | 6 | Goal trophy: a gold star in a pulsing glow ring with an orbiting glint. |
| 7 | heart | 4 | Heart pickup bobbing above a small ground shadow. |
checkpoint: 128x64, 16x32 frames, 8 columns x 2 rows
Identity: twoDKit.art.fx.checkpoint. The pole's stone base sits on the frame's bottom row, centred on x=8.
| Row | Name (checkpointRows) | Frames | What |
|---|---|---|---|
| 0 | idle | 4 | Not yet reached: a dim knob and a grey flag hanging low, fluttering slightly. |
| 1 | reached | 8 | Reached: a red and gold flag raised to the top and waving, with a glowing cyan gem and pulsing sparkles. |