Configs2026年5月19日·1 分钟阅读

LÖVE — Free 2D Game Framework for Lua

LÖVE is a free, open-source framework for making 2D games in Lua. It provides modules for graphics, audio, physics, and input, letting developers focus on game logic rather than engine plumbing.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
LÖVE 2D Game Framework
通用 CLI 安装命令
npx tokrepo install cc2879c0-5339-11f1-9bc6-00163e2b0d79

Introduction

LÖVE (also called Love2D) is a framework for creating 2D games in Lua. It has been actively developed since 2008 and is known for its simplicity: a game is a folder with a main.lua file that defines callback functions. The framework handles the window, rendering, audio, input, and physics so developers can prototype rapidly.

What LÖVE Does

  • Renders 2D graphics using OpenGL with support for sprites, shapes, shaders, and canvases
  • Provides a built-in Box2D physics engine via the love.physics module
  • Handles audio playback with support for WAV, OGG, MP3, and streaming large files
  • Manages keyboard, mouse, gamepad, and touch input through callback functions
  • Packages games into standalone executables for Windows, macOS, Linux, Android, and iOS

Architecture Overview

LÖVE is written in C++ and embeds LuaJIT as its scripting runtime. The engine runs a main loop that calls user-defined Lua callbacks: love.update(dt) for logic and love.draw() for rendering. Each subsystem (graphics, audio, physics, filesystem) is exposed as a Lua module. The rendering backend uses OpenGL ES on mobile and OpenGL on desktop, abstracted behind a unified API.

Self-Hosting & Configuration

  • Download binaries from the official site or install via package managers (brew, apt, scoop)
  • Games are directories or .love files (renamed ZIP archives containing Lua source)
  • Configure window properties in conf.lua with love.conf(t) for resolution, fullscreen, and vsync
  • Distribute by appending a .love file to the LÖVE binary to create a standalone executable
  • Android and iOS builds use the official LÖVE app or custom build templates

Key Features

  • LuaJIT scripting for near-native performance with a beginner-friendly language
  • GLSL shader support via love.graphics.newShader for custom visual effects
  • Canvas (off-screen render targets) for post-processing, minimaps, and layered rendering
  • Thread module for running Lua code in parallel for asset loading or computation
  • Filesystem sandboxing that isolates game save data per project

Comparison with Similar Tools

  • Pygame — Python-based; LÖVE uses Lua and generally offers better performance and simpler packaging
  • Godot — full engine with editor; LÖVE is a code-only framework with a smaller footprint
  • Raylib — C library; LÖVE provides a higher-level Lua API with built-in physics
  • Defold — GUI editor with Lua scripting; LÖVE is editor-agnostic and more lightweight
  • MonoGame — C#/.NET framework; LÖVE is simpler to start with but less suited for large projects

FAQ

Q: What language does LÖVE use? A: Lua, specifically LuaJIT. No compilation step is needed; games run directly from source files.

Q: Can LÖVE make 3D games? A: LÖVE is designed for 2D. Basic 3D is possible via custom shaders and mesh manipulation, but dedicated 3D engines are better suited.

Q: How do I distribute a LÖVE game? A: Zip your game folder as a .love file, then fuse it with the LÖVE binary for each target platform to create a standalone executable.

Q: Is LÖVE suitable for commercial games? A: Yes. LÖVE is licensed under zlib/libpng, allowing use in commercial projects without royalties or attribution requirements.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产