Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Structure and debug a LÖVE (Love2D) game in Lua: the love.load/update/draw loop, delta-time movement, input, and screen states. Use when building a LÖVE 11.x game (main.lua, conf.lua, .love).
.claude/skills/gamedev-skills-love2d-core/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 64% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 59% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 53% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 63% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 107% | 0% |
Set up and debug the foundation of a LÖVE game in Lua: the callback loop, frame-rate- independent movement, input, and screen states. Targets LÖVE 11.5.
main.lua/conf.lua, or fixing the core loop,movement that runs at the wrong speed, input handling, or screen switching.
main.lua calling love.*, a conf.lua, or a .love file.When not to use: Lua language questions unrelated to LÖVE; physics bodies/joints (LÖVE uses Box2D via love.physics — a separate concern); shader code (love.graphics GLSL is its own topic). For cross-engine save/load patterns, use save-systems.
main.lua; it should definelove.load() (one-time setup), love.update(dt) (state), and love.draw() (rendering). Window/version setup goes in conf.lua (run before modules load).
t.version = "11.5" in conf.lua so LÖVE warns on mismatch.dt (delta time, in seconds) so speed is frame-rate independent.love.keyboard.isDown in update, for held keys) andevent (love.keypressed callback, for discrete presses).
if flags — see Patterns and references/state-stack.md.
love . from the project folder; verify the window,motion speed, and input on screen before assuming it works.
main.lua skeleton (the callback loop + input)lua-- main.lua — LÖVE calls these callbacks for you. Colors are 0–1 in LÖVE 11.x. function love.load() -- One-time setup. speed is in PIXELS PER SECOND, not per frame. player = { x = 100, y = 100, size = 40, speed = 220 } love.graphics.setBackgroundColor(0.1, 0.1, 0.12) end function love.update(dt) -- Polled input: good for continuous movement while a key is held. if love.keyboard.isDown("right") then player.x = player.x + player.speed * dt end if love.keyboard.isDown("left") then player.x = player.x - player.speed * dt end if love.keyboard.isDown("down") then player.y = player.y + player.speed * dt end if love.keyboard.isDown("up") then player.y = player.y - player.speed * dt end end function love.draw() love.graphics.setColor(0.2, 0.8, 1.0) -- tint ON love.graphics.rectangle("fill", player.x, player.y, player.size, player.size) love.graphics.setColor(1, 1, 1) -- reset tint before text/images love.graphics.print("Arrow keys to move, Esc to quit", 10, 10) end function love.keypressed(key) -- Event input: fires once per physical press. Use for menus, jumps, toggles. if key == "escape" then love.event.quit() end end
lua-- RIGHT: scaled by dt → same real-world speed at 30 or 240 FPS. player.x = player.x + player.speed * dt -- WRONG: "pixels per frame" → moves twice as fast at double the frame rate. player.x = player.x + player.speed
conf.lua (window + version; runs before main.lua)lua-- conf.lua — must be its own file; love.conf will NOT run from main.lua. function love.conf(t) t.version = "11.5" -- the LÖVE version this game targets (string "X.Y") t.window.title = "My LÖVE Game" t.window.width = 800 t.window.height = 600 t.window.vsync = 1 -- number since 11.0: 1 = on, 0 = off, -1 = adaptive t.window.resizable = false t.modules.physics = false -- disable modules you don't use to trim startup/memory end
lua-- LÖVE 11.x uses normalized floats. (Pre-11.0 code used 0–255 and will look wrong.) love.graphics.setColor(1, 0, 0) -- opaque red love.graphics.setColor(0.2, 0.8, 1.0, 0.5) -- translucent cyan (alpha 0.5) -- Need to convert old byte values? Use the helper instead of dividing by hand: love.graphics.setColor(love.math.colorFromBytes(128, 234, 255))
lua-- A screen is a table with optional :update(dt), :draw(), :keypressed(key). -- Keep the active screen on a stack so pause/menu overlays are trivial to pop. local Stack = require("state_stack") -- see references/state-stack.md for the module function love.load() Stack.push(require("screens.menu")) end function love.update(dt) Stack.current():update(dt) end function love.draw() Stack.current():draw() end function love.keypressed(key) Stack.current():keypressed(key) end
* dt. Every per-frame change to position, timers,or animation must be scaled by dt.
love.conf placed in main.lua → it silently does nothing. It must live in conf.lua,which LÖVE runs before loading modules.
setColor(255,0,0)clamps to white; use setColor(1,0,0) or love.math.colorFromBytes.
setColor → color is global and persists across draws.Reset with love.graphics.setColor(1, 1, 1) before drawing text/images you want untinted.
love.keypressed(key, scancode, isrepeat)fires on press (and OS key-repeat); use love.keyreleased for release, and check isrepeat if you must ignore held-key repeats.
callbacks), read references/state-stack.md.
save-systems — saving/loading game state (engine-agnostic).input-systems — rebindable, multi-device input architecture.pygame-core / phaser-core — the same loop concepts in other lightweight engines.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 13,842 | 9,619 | -31% | 1 | 1 | 0% | 2,499 | 4,098 | +64% | 0 | 0 | — |
case-02 | pass→pass | 9,144 | 6,076 | -34% | 1 | 1 | 0% | 1,787 | 2,833 | +59% | 0 | 0 | — |
case-03 | pass→pass | 10,579 | 7,152 | -32% | 1 | 1 | 0% | 2,135 | 3,260 | +53% | 0 | 0 | — |
case-04 | pass→pass | 11,179 | 8,857 | -21% | 1 | 1 | 0% | 2,237 | 3,653 | +63% | 0 | 0 | — |
case-05 | pass→pass | 6,794 | 3,983 | -41% | 1 | 1 | 0% | 1,309 | 2,707 | +107% | 0 | 0 | — |
case-06 | pass→pass | 6,676 | 4,927 | -26% | 1 | 1 | 0% | 1,347 | 2,841 | +111% | 0 | 0 | — |
case-07 | pass→pass | 5,396 | 3,750 | -31% | 1 | 1 | 0% | 1,054 | 2,621 | +149% | 0 | 0 | — |
case-08 | pass→pass | 8,048 | 6,824 | -15% | 1 | 1 | 0% | 1,802 | 3,345 | +86% | 0 | 0 | — |
case-09 | pass→pass | 9,068 | 4,465 | -51% | 1 | 1 | 0% | 1,708 | 2,735 | +60% | 0 | 0 | — |
case-10 | pass→pass | 12,472 | 13,089 | +5% | 1 | 1 | 0% | 2,498 | 4,880 | +95% | 0 | 0 | — |
case-11 | pass→pass | 9,737 | 4,731 | -51% | 1 | 1 | 0% | 1,730 | 2,805 | +62% | 0 | 0 | — |
case-12 | pass→pass | 7,359 | 4,914 | -33% | 1 | 1 | 0% | 1,459 | 2,866 | +96% | 0 | 0 | — |
case-13 | pass→pass | 6,829 | 3,640 | -47% | 1 | 1 | 0% | 1,329 | 2,583 | +94% | 0 | 0 | — |
case-14 | pass→pass | 3,135 | 3,200 | +2% | 1 | 1 | 0% | 574 | 2,510 | +337% | 0 | 0 | — |
case-15 | pass→pass | 8,232 | 6,415 | -22% | 1 | 1 | 0% | 1,597 | 3,031 | +90% | 0 | 0 | — |
case-16 | pass→pass | 5,760 | 4,374 | -24% | 1 | 1 | 0% | 1,202 | 2,752 | +129% | 0 | 0 | — |
case-17 | pass→pass | 8,760 | 5,923 | -32% | 1 | 1 | 0% | 1,649 | 2,800 | +70% | 0 | 0 | — |
case-18 | pass→pass | 3,767 | 3,296 | -13% | 1 | 1 | 0% | 745 | 2,474 | +232% | 0 | 0 | — |
case-19 | pass→pass | 12,769 | 10,386 | -19% | 1 | 1 | 0% | 2,694 | 4,072 | +51% | 0 | 0 | — |
case-20 | pass→pass | 16,611 | 9,594 | -42% | 1 | 1 | 0% | 2,762 | 3,800 | +38% | 0 | 0 | — |
case-21 | pass→pass | 11,972 | 10,708 | -11% | 1 | 1 | 0% | 2,489 | 4,035 | +62% | 0 | 0 | — |
case-22 | pass→pass | 22,337 | 22,702 | +2% | 1 | 1 | 0% | 4,456 | 5,646 | +27% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +5 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.