Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计异常

love2d-gamedevlove2d 游戏开发

Agent Skill

love2d-gamedev 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,285

周安装

53

GitHub Stars

15

下载量

420
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:love2d-gamedev(love2d 游戏开发)
来源仓库:https://github.com/chongdashu/love2d-pocket-bomber-game
仓库路径:skills/love2d-gamedev
安装命令:
npx skills add https://github.com/chongdashu/love2d-pocket-bomber-game --skill love2d-gamedev
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/chongdashu/love2d-pocket-bomber-game --skill love2d-gamedev

简介

用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息。

  • 适合在需要围绕代码变更或协作事项进行整理时使用。
  • 可结合来源仓库与原始 README 继续核验具体用法。
  • 安装前建议确认权限范围与维护状态。love2d-gamedev 属于前端设计类 Skill,可作为该场景下的辅助能力补充。
  • 注意是否会触发联网、命令执行或文件读写操作。

SKILL.md

Love2D Game Development

Build polished 2D games with the Love2D framework—from first prototype to iOS release.

Quick Reference

TopicWhen to Use
Core ArchitectureUnderstanding game loop, callbacks, modules
Graphics & DrawingImages, colors, transforms, screen adaptation
AnimationSprite sheets, quads, frame timing
Tiles & MapsTile-based levels, map loading
CollisionAABB, circle, and separating axis collision
AudioSound effects, music, volume control
Project StructureFile organization, conf.lua, distribution
LibrariesPopular community libraries
iOS DeploymentBuild, touch controls, App Store

The Love2D Game Loop

Every Love2D game follows this pattern:

function love.load()
    -- Called once at startup
    -- Load assets, initialize state
end

function love.update(dt)
    -- Called every frame
    -- dt = time since last frame (seconds)
    -- Update game logic here
end

function love.draw()
    -- Called every frame after update
    -- All rendering happens here
end

Key insight: dt (delta time) ensures consistent speed across frame rates.

-- WRONG: Speed varies with frame rate
player.x = player.x + 5

-- RIGHT: 200 pixels per second, regardless of FPS
player.x = player.x + 200 * dt

Essential Patterns

Loading and Drawing Images

function love.load()
    playerImage = love.graphics.newImage("player.png")
end

function love.draw()
    love.graphics.draw(playerImage, x, y)
    -- Full signature: draw(image, x, y, rotation, scaleX, scaleY, originX, originY)
end

Input Handling

-- Polling (check every frame)
function love.update(dt)
    if love.keyboard.isDown("left") then
        player.x = player.x - 200 * dt
    end
end

-- Event-based (fires once per press)
function love.keypressed(key)
    if key == "space" then
        player:jump()
    end
end

Screen-Adaptive Positioning

Never hard-code screen dimensions:

function love.load()
    screenW, screenH = love.graphics.getDimensions()
end

function love.resize(w, h)
    screenW, screenH = w, h
end

function love.draw()
    -- Position relative to screen
    local centerX = screenW / 2
    local bottomY = screenH - 50
end

Core Modules

ModulePurposeKey Functions
love.graphicsRenderingdraw, rectangle, circle, print, setColor
love.audioSoundnewSource, play, stop, setVolume
love.keyboardKeyboard inputisDown, keypressed callback
love.mouseMouse inputgetPosition, isDown, callbacks
love.touchTouch inputtouchpressed, touchmoved, touchreleased
love.filesystemFile I/Oread, write, getInfo
love.timerTiminggetDelta, getTime, getFPS
love.windowWindow controlsetMode, getMode, setTitle
love.physicsBox2D physicsnewWorld, newBody, newFixture

Project Setup

Minimal Project

my-game/
├── main.lua      # Entry point (required)
└── conf.lua      # Configuration (optional but recommended)

conf.lua Template

function love.conf(t)
    t.window.title = "My Game"
    t.window.width = 800
    t.window.height = 600
    t.version = "11.5"              -- Love2D version
    t.console = true                -- Enable console on Windows

    -- Disable unused modules for faster startup
    t.modules.joystick = false
    t.modules.physics = false
end

Running the Game

# macOS
/Applications/love.app/Contents/MacOS/love /path/to/game

# Create alias in ~/.zshrc
alias love="/Applications/love.app/Contents/MacOS/love"

Common Patterns

State Management

local gameState = "menu"  -- menu, playing, paused, gameover

function love.update(dt)
    if gameState == "playing" then
        updateGame(dt)
    end
end

function love.draw()
    if gameState == "menu" then
        drawMenu()
    elseif gameState == "playing" then
        drawGame()
    end
end

Object-Oriented Entities

local Player = {}
Player.__index = Player

function Player:new(x, y)
    return setmetatable({
        x = x, y = y,
        speed = 200,
        image = love.graphics.newImage("player.png")
    }, Player)
end

function Player:update(dt)
    if love.keyboard.isDown("right") then
        self.x = self.x + self.speed * dt
    end
end

function Player:draw()
    love.graphics.draw(self.image, self.x, self.y)
end

return Player

Camera/Viewport

local camera = { x = 0, y = 0 }

function love.draw()
    love.graphics.push()
    love.graphics.translate(-camera.x, -camera.y)

    -- Draw world objects here
    drawWorld()

    love.graphics.pop()

    -- Draw UI here (not affected by camera)
    drawUI()
end

Anti-Patterns to Avoid

Don'tWhyDo Instead
Hard-code coordinatesBreaks on different screensUse percentages or anchors
Forget dt in movementSpeed varies with frame rateMultiply by dt
Load assets in update/drawLoads every frame, kills performanceLoad once in love.load
Use global variables everywhereHard to track, name collisionsUse local variables and modules
Test only on desktopTouch behaves differentlyTest on device early

iOS Development

For iOS deployment, see the iOS Overview which covers:

Quick iOS checklist:

  1. Download Love2D iOS source + Apple libraries
  2. Copy libraries to Xcode project
  3. Fix deployment target (8.0 → 15.0)
  4. Create game.love (zip of Lua files)
  5. Add game.love to Xcode bundle resources
  6. Configure signing and deploy

Philosophy

Love2D makes game development joyful through simplicity:

  1. Lua is approachable - Dynamic typing, clean syntax, fast iteration
  2. The API is consistent - Functions follow predictable patterns
  3. You own the game loop - No hidden magic, full control
  4. Cross-platform by default - Same code runs on Windows, macOS, Linux, iOS, Android

The goal isn't just "make it work." The goal is "make it feel great."

Smooth animations, responsive controls, adaptive layouts—that's the standard for polished games.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.65%
按下载量换算141

Claude

32.29%
按下载量换算136

Cursor

16.91%
按下载量换算71

Gemini CLI

10.12%
按下载量换算43

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills