melonjs
它能做什么
它是 melonJS 游戏开发的起点,指向每个主题的详细指南。适用于使用 melonJS 引擎制作浏览器游戏的开发者。
适用场景
- ✓当开发者开始任何 melonJS 任务,需要知道应先阅读哪份指南时。
- ✓当开发者在处理 3D 内容,需要在编写代码前了解坐标规则时。
- ✓当开发者凭记忆编写 melonJS 代码,可能在使用过时的方法时。
技能链接
https://github.com/melonjs/melonJS/blob/master/packages/melonjs/skills/melonjs/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我想用 melonJS 做一个二维平台游戏。我应该阅读哪些指南?”
每周 5 个新技能,1 分钟读完。
工作原理
该技能充当路由。它列出各主题指南,建议在涉及旧代码时阅读较新的迁移指南,并告诉 AI 不要猜测未列出的 API。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
melonJS
Entry point for the melonJS skill collection. melonJS is an open-source HTML5 game engine for indie developers, covering 2D, 2.5D and 3D — perspective and orthogonal cameras, GPU-accelerated tilemap rendering, post-processing effects, custom shaders, 3D meshes, polygon-accurate physics and modern Tiled workflows. It runs on WebGPU, WebGL 2 or Canvas with automatic fallback, and has no runtime dependencies.
How to use this skill
- Find the specialised skill below that matches the task and follow it.
- If the task involves anything 3D, read
melonjs-3dfirst — melonJS's coordinate conventions are the inverse of OpenGL's, so untutored 3D instincts are backwards. - If you are writing melonJS from prior knowledge rather than from the current
docs, read
melonjs-20-migration— most published melonJS material predates 20.0 and its bootstrap no longer exists. - If none of them covers the task, use the escape hatch below rather than guessing at an API.
Skill router
| Skill | Load when… |
|---|---|
| melonjs-getting-started | Bootstrapping a game, new Application, await app.init(), choosing a renderer, preloading assets. |
| melonjs-20-migration | Code based on melonJS 19.x or earlier, or an API that "should exist" but doesn't — video.init, Entity, renderable.shader =. |
| melonjs-scenes-and-state | Stage subclasses, the state manager, transitions, pausing, the update loop, timers, tweens, saved data. |
| melonjs-renderables | Subclassing Renderable, custom draw(), draw order, anchors, floating, post effects on an object. |
| melonjs-sprites-and-animation | Sprite, frame animation, texture atlases (TexturePacker / Aseprite / ShoeBox), tint, flip, pooling. |
| melonjs-input | Keyboard actions, pointer and touch handling, drag, gamepad, virtual controls (fixed or floating sticks and buttons, tap to act). |
| melonjs-physics | Collision, bodies, movement, spatial queries, and the planck / matter adapters. |
| melonjs-math | Vectors and matrices: what mutates, what allocates, and interpolating with lerp, slerp, damp or moveTowards. |
| melonjs-tilemaps | Tiled maps — TMX/TSX loading, spawning entities from objects, collision layers, isometric maps, reading and changing tiles at run time (a tile layer as the game board). |
| melonjs-audio | Sound effects, music, audio sprites, spatial audio, procedural tone and noise. |
| melonjs-effects-and-shaders | Post effects, custom GLSL/WGSL shaders, blend modes, colour grading, screen capture. |
| melonjs-3d | Anything 3D or 2.5D — Camera3d, meshes, instancing, Sprite3d billboards, Light3d, distance fog, glTF scenes. |
| melonjs-3d-assets | Loading glTF/GLB or OBJ models — materials, imported lights, instancing, and what is not supported. |
| melonjs-camera-and-drawing | Camera follow, bounds, shake and fade, coordinate conversion, and immediate-mode shape drawing. |
| melonjs-ui-and-text | HUDs, buttons, menus, drag-and-drop, Text and BitmapText, web fonts, panels. |
| melonjs-particles-and-trails | ParticleEmitter, burst versus stream, referenceSpace, and the Trail renderable. |
| melonjs-lighting | 2D dynamic lighting — Light2d, stage ambient, normal-mapped sprites. |
| melonjs-deployment | Scaffolding a project, building, browser support and transpiling, native and mini-game platforms. |
| melonjs-loading-assets | Resource descriptors, the asset type list, base URLs, cross-origin, progress events, unloading. |
| melonjs-renderer-backends | A feature works on one machine but not another; choosing or pinning a backend; degrading gracefully. |
| melonjs-display-and-scaling | Blurry, soft or cropped output; the design resolution, how the canvas fills its page, and pix |
常见问题
这是一个独立的教程吗?
不是。它指向每个 melonJS 主题的更详细指南。
我应该阅读哪份指南来学习 3D?
该技能说明应先阅读 3D 指南,因为其坐标规则与 OpenGL 正好相反。
如果列表中没有我的主题怎么办?
该技能说明应使用它的兜底方式,而不是猜测某个 API。
详情
作者的原始描述
Use this skill FIRST for any melonJS task; it routes to the right specialised skill and lists the companion packages. melonJS is an open-source 2D, 2.5D and 3D HTML5 game engine running on WebGPU, WebGL 2 or Canvas. Covers Application setup, the scene graph, renderables, sprites, tilemaps, physics, audio, particles, shaders, and the 3D tier — perspective cameras, meshes and glTF scenes. Triggers on: melonjs, melonJS, me.game, Application, app.init, app.world, Renderable, Sprite, Stage, state.change, Camera2d, Camera3d, Mesh, tilemap, Tiled, TMX, ParticleEmitter, ShaderEffect, how do I make a g
repo: melonjs/melonJS
热度
- GitHub 星标
- 6.4k
- 排名
- #14218
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
melonjs-20-migration
6.4k帮你的智能体按 melonJS 20 版本编写游戏代码,避免使用旧版本中已过时的方法,例如必需的异步启动。
melonjs-3d-assets
6.4k帮你的智能体将 glTF、GLB 和 OBJ 等 3D 模型加载到 melonJS 浏览器游戏中,并提供缩放和光照选项。
melonjs-3d
6.4k帮你的智能体在 melonJS 浏览器游戏中构建 3D 或 2.5D 场景,涵盖相机、网格、灯光和深度,并遵循引擎自身的坐标轴规则。
melonjs-audio
6.4k帮你的智能体为 melonJS 游戏添加音效和音乐,包括音频设置、背景音轨、音量控制和空间声音。