melonjs
Skill này làm gì
Đây là điểm bắt đầu để phát triển trò chơi melonJS, trỏ đến các hướng dẫn chi tiết cho từng chủ đề. Dành cho lập trình viên làm trò chơi trình duyệt với engine melonJS.
Khi nào nên dùng
- ✓Khi lập trình viên bắt đầu một tác vụ melonJS và cần biết nên đọc hướng dẫn nào trước.
- ✓Khi lập trình viên làm việc với nội dung 3D và cần các quy tắc tọa độ trước khi viết mã.
- ✓Khi lập trình viên viết mã melonJS từ trí nhớ và có thể đang dùng một phương thức đã lỗi thời.
Liên kết skill
https://github.com/melonjs/melonJS/blob/master/packages/melonjs/skills/melonjs/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tôi muốn làm một platformer 2D bằng melonJS. Tôi nên đọc những hướng dẫn nào?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill hoạt động như một bộ định tuyến. Nó liệt kê các hướng dẫn theo chủ đề, khuyên đọc hướng dẫn di chuyển mới hơn nếu có mã cũ, và bảo AI không đoán các API không được liệt kê.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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 |
Câu hỏi thường gặp
Đây có phải là hướng dẫn độc lập không?
Không. Nó trỏ đến các hướng dẫn chi tiết hơn về từng chủ đề melonJS.
Tôi nên đọc hướng dẫn nào cho 3D?
Skill khuyên đọc hướng dẫn 3D trước, vì quy tắc tọa độ của nó ngược với OpenGL.
Nếu chủ đề không được liệt kê thì sao?
Skill nói nên dùng lối thoát dự phòng của nó thay vì đoán một API.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 6.4k
- Vị trí xếp hạng
- #14218
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
melonjs-20-migration
6.4kGiúp agent của bạn viết mã trò chơi melonJS cho phiên bản 20 và tránh các phương thức cũ, như bước khởi động bất đồng bộ bắt buộc.
melonjs-3d-assets
6.4kGiúp agent của bạn tải mô hình 3D như file glTF, GLB và OBJ vào trò chơi trình duyệt melonJS, kèm tùy chọn tỷ lệ và ánh sáng.
melonjs-3d
6.4kGiúp agent của bạn xây dựng cảnh 3D hoặc 2.5D trong trò chơi trình duyệt melonJS, gồm camera, lưới, đèn và độ sâu, theo quy tắc trục của công cụ.
melonjs-audio
6.4kGiúp agent của bạn thêm hiệu ứng âm thanh và nhạc nền vào trò chơi melonJS, gồm thiết lập âm thanh, nhạc nền, điều chỉnh âm lượng và âm thanh không gian.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.