惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
V
Visual Studio Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
博客园 - 【当耐特】
博客园 - 叶小钗
量子位
博客园 - 聂微东
S
SegmentFault 最新的问题
美团技术团队
Hugging Face - Blog
Hugging Face - Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
月光博客
月光博客
宝玉的分享
宝玉的分享
小众软件
小众软件
罗磊的独立博客
有赞技术团队
有赞技术团队
Stack Overflow Blog
Stack Overflow Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Announcing Limn Engine — A Lightweight 2D Game Framework ...
Kehinde Owolabi · 2026-06-11 · via DEV Community
Cover image for Announcing Limn Engine — A Lightweight 2D Game Framework for the Browser

Kehinde Owolabi

Announcing Limn Engine

I'm excited to launch Limn Engine — a lightweight, zero-dependency HTML5 Canvas game framework for the browser. No npm install. No build step. No bloated dependency tree. Drop in a single script and start making 2D games.

The Core Idea: Display + Component

Limn Engine is built around two classes that cover 90% of what you need in a 2D game:

Display — The Game Shell

A singleton Display class that manages the canvas, runs the game loop, handles keyboard and mouse input, controls the camera, and manages scenes. Setting up a game is a one-liner:

const display = new Display();  
display.start(800, 600);  
Let me try creating it step by step.

Component — Every Object in Your Game

A unified Component class that combines position, size, color/image, velocity, physics, and collision detection. No separate "Sprite" and "Body" classes — one object does it all.

const player = new Component(40, 40, "blue", 100, 100);

Components support three modes:

  • Rectangle — solid color shapes for rapid prototyping
  • Image — loaded from spritesheets or single image files
  • Text — the Tctxt subclass for text elements with backgrounds, padding, and alignment

Key Features

Dual-Canvas High-Performance Rendering

Call display.perform() to activate dual-canvas mode. Static backgrounds and tilemaps are drawn once to an offscreen buffer, then composited as a single drawImage() call per frame. This dramatically reduces draw calls and improves frame rates for complex scenes.

display.perform();
display.start(800, 600);

Tilemap Levels

Define game worlds as 2D arrays and initialize the tilemap engine with one call. Supports dynamic tile placement during gameplay — great for destructible environments and breakable blocks.

display.map = [
  [1, 1, 1, 1, 1],
  [1, 0, 0, 0, 1],
  [1, 0, 9, 0, 1],
  [1, 0, 0, 0, 1],
  [1, 1, 1, 1, 1]
];
display.tileMap();

Sprite & AnimatedSprite

Load horizontal spritesheets and define named animation clips (idle, run, jump). Animations can loop, ping-pong, or play once — with frame timing and direction flipping built in.

const hero = new AnimatedSprite("hero.png", 64, 64, 400, 300);
hero.addAnimation("idle", 0, 3, 8, true);
hero.addAnimation("run",  4, 7, 12, true);
hero.play("idle");

Physics & Collision Detection

Enable physics on any component with a single property. Built-in collision detection supports both AABB (rectangle) and circular hitboxes.

player.physics = true;
player.gravity = 0.5;
player.bounce = 0.3;

if (player.collide(platforms)) {
  player.posY = platform.y - player.height;
  player.speedY = 0;
}

Background Effects

Build rich environments with linear and radial gradient backgrounds, solid colors, and a parallax skybox component for atmospheric depth.

display.lgradient("top", "royalblue", "midnightblue");
display.fullscreen();

Audio

Built-in support for background music and sound effects to complete the game experience.

Why Limn?

There are plenty of game frameworks out there. Here's what makes Limn different:

  • Zero dependencies — No npm, no webpack, no node_modules. One file, one script tag.
  • Small footprint — Tiny enough to read through and understand in a single