EngineLÖVE 11.x
LanguageLua 5.1 (LuaJIT)
Time to run~4 minutes
LevelIntermediate — comfortable with Lua tables and metatables
OutputOne module (~140 lines)
DependenciesNone.

The prompt

Open claude.ai/new, paste, send.

$ Build me a custom particle system module for LÖVE 11.x in pure Lua.

// shape
- A module returned via "return Particles" exposing:
  - Particles.new_emitter(opts) → emitter instance
  - emitter:emit(n) — spawn n particles
  - emitter:update(dt)
  - emitter:draw()

// emitter options
- position: { x, y }
- lifetime: { min, max } seconds
- speed: { min, max } pixels/sec
- direction: { angle, spread } radians (angle = base direction, spread = +- random offset)
- gravity: { x, y } pixels/sec^2
- size: { start, end } pixels (linearly interpolated over particle lifetime)
- colors: { start, end } each = {r,g,b,a} (linearly interpolated)

// behavior
- update(dt) advances every particle: position by velocity * dt, velocity by gravity * dt, age by dt. Removes particles whose age > lifetime.
- draw() iterates particles. For each: compute t = age / lifetime, lerp size and color, draw a love.graphics.rectangle("fill", ...) at the current position with the lerped size.

// constraints
- Pure Lua, no external libs.
- No globals. Each emitter is independent.
- Use love.graphics.setColor / love.graphics.rectangle. No SpriteBatches, no shaders.
- Cap particles at 500 per emitter. Drop new emits if at cap.

// return format
- One file particles.lua in a code block.
- Include a 12-line example showing a "coin pickup" sparkle effect from love.update.
- No prose before or after.
Open in Claude ▸ Run · 4 min

What this gets you

"Game feel" without locking into a framework. Hit sparks, pickup glitter, dust on landing — all of these are five-line emitter configs with this module. Building your own gives you exactly the parameter set you need; LOVE's built-in ParticleSystem covers a different surface area and is more verbose for simple effects.

Quick checklist

Full breakdown coming soon

The deeper writeup with worked examples (sparkle, dust, fire, sparks) and how to switch to image-based particles is on the roadmap. Bookmark this page.