본문으로 건너뛰기
cccskills
무료GitHub에 공개

melonjs

Use this entry point to find the melonJS guide for a game development task, from application setup and scenes to sprites, input, physics, audio, and 3D. It also points to companion packages and the API index when the guides do not cover a need.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

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 game, HTML5 game engine.

melonjs/melonJS스타 6,429(GitHub 6,429 + cccskills 0)

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Choose a guide for a melonJS game task
  • Find the right setup steps for a new game
  • Locate guidance for a 3D scene or imported model
  • Check companion packages or find an API entry

포함된 파일(1)

  • SKILL.md10.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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

  1. Find the specialised skill below that matches the task and follow it.
  2. If the task involves anything 3D, read melonjs-3d first — melonJS's coordinate conventions are the inverse of OpenGL's, so untutored 3D instincts are backwards.
  3. 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.
  4. If none of them covers the task, use the escape hatch below rather than guessing at an API.

Skill router

SkillLoad when…
melonjs-getting-startedBootstrapping a game, new Application, await app.init(), choosing a renderer, preloading assets.
melonjs-20-migrationCode based on melonJS 19.x or earlier, or an API that "should exist" but doesn't — video.init, Entity, renderable.shader =.
melonjs-scenes-and-stateStage subclasses, the state manager, transitions, pausing, the update loop, timers, tweens, saved data.
melonjs-renderablesSubclassing Renderable, custom draw(), draw order, anchors, floating, post effects on an object.
melonjs-sprites-and-animationSprite, frame animation, texture atlases (TexturePacker / Aseprite / ShoeBox), tint, flip, pooling.
melonjs-inputKeyboard actions, pointer and touch handling, drag, gamepad, virtual controls.
melonjs-physicsCollision, bodies, movement, spatial queries, and the planck / matter adapters.
melonjs-mathVectors and matrices: what mutates, what allocates, and interpolating with lerp, slerp, damp or moveTowards.
melonjs-tilemapsTiled maps — TMX/TSX loading, spawning entities from objects, collision layers, isometric maps.
melonjs-audioSound effects, music, audio sprites, spatial audio, procedural tone and noise.
melonjs-effects-and-shadersPost effects, custom GLSL/WGSL shaders, blend modes, colour grading, screen capture.
melonjs-3dAnything 3D or 2.5D — Camera3d, meshes, instancing, Sprite3d billboards, Light3d, distance fog, glTF scenes.
melonjs-3d-assetsLoading glTF/GLB or OBJ models — materials, imported lights, instancing, and what is not supported.
melonjs-camera-and-drawingCamera follow, bounds, shake and fade, coordinate conversion, and immediate-mode shape drawing.
melonjs-ui-and-textHUDs, buttons, menus, drag-and-drop, Text and BitmapText, web fonts, panels.
melonjs-particles-and-trailsParticleEmitter, burst versus stream, referenceSpace, and the Trail renderable.
melonjs-lighting2D dynamic lighting — Light2d, stage ambient, normal-mapped sprites.
melonjs-deploymentScaffolding a project, building, browser support and transpiling, native and mini-game platforms.
melonjs-loading-assetsResource descriptors, the asset type list, base URLs, cross-origin, progress events, unloading.
melonjs-renderer-backendsA feature works on one machine but not another; choosing or pinning a backend; degrading gracefully.
melonjs-display-and-scalingBlurry, soft or cropped output; the design resolution, how the canvas fills its page, and pixel-perfect integer scaling.
melonjs-eventsThe event bus, per-frame and lifecycle events, and subscribing without leaking.
melonjs-performanceDropped frames, draw-call counts, pooling, batching, culling, baking, profiling.
melonjs-pluginsRegistering the debug, Spine or Tiled-inflate plugins, physics adapters, or writing your own plugin.

Escape hatch: the full API index

These skills are hand-written and deliberately partial — they cover the paths people actually take and the mistakes those paths invite. When the task needs something they do not mention, do not infer an API from the shape of the engine. Fetch the generated index instead:

https://melonjs.github.io/melonJS/llms.txt

It is regenerated on every docs build from the same TSDoc comments the reference pages render, so it is always current for master. It lists every exported class, function, interface, type and namespace with a one-line summary and a link to its page — fetch the pages you need from there.

Two things it gives you that this collection cannot:

  • Members. The skills name classes; llms.txt links to the page listing every method, property, default and @since tag on them.
  • Deprecations. Entries marked **deprecated** are exactly the APIs that a model trained on older melonJS material will reach for. If something you were about to write appears with that marker, follow the page for the replacement.

If a class, function, namespace or type is absent from llms.txt, it is absent from the engine's public API — that is the useful negative answer, and it is worth acting on rather than writing code around something that does not exist. The index lists top-level exports only, so a member missing from it proves nothing: follow the owning class's page to check that.

The three rules that catch everyone

Whatever the task, these produce code that runs and is wrong:

  1. await app.init() is mandatory since 20.0. The constructor builds the world but not the renderer: a plain renderable can still be added and simply never draws, while new Sprite(...) / new Text(...) throw a TypeError on the global game, which is unset until the first init() resolves. Neither symptom names the missing call.
  2. addChild(child, z) is the only way to set draw order. renderable.z does not exist; setting depth before addChild is overwritten, and setting it after does not resort (except under Camera3d).
  3. isKinematic defaults to true, which silently excludes a renderable from pointer events and from the physics broadphase. Plain Renderable and Sprite subclasses need this.isKinematic = false.

Companion packages

melonJS ships optional packages alongside the engine. Reach for these rather than reimplementing what they cover — and note the physics adapters and the Tiled inflate plugin are required for their use cases, not merely convenient.

PackageUse when
@melonjs/planck-adapterYou want full rigid-body dynamics — stacking, joints, realistic restitution. Pass it as the Application's physic setting; the portable raycast and queryAABB calls work unchanged across adapters (querySphere and raycast3d are built-in-adapter only).
@melonjs/matter-adapterSame, backed by matter-js. Choose one adapter per game.
@melonjs/tiled-inflate-pluginRequired to load gzip-, zlib- or zstd-compressed Tiled maps. Without it, parsing such a map throws No inflate function set.
@melonjs/spine-pluginSkeletal animation authored in Spine, as a melonJS renderable.
@melonjs/debug-pluginAn in-game debug panel — FPS, draw counts, collision-shape and bounds overlays. Register it after app.init().
@melonjs/capacitor-pluginWrapping a game as a native iOS/Android app: it bridges Capacitor's lifecycle — pause/resume, the hardware back button, orientation lock, splash screen.
create-melonjsScaffolding a new project — start here rather than assembling a build by hand.

Plugins are registered after init(), into a global registry:

import { plugin } from "melonjs";
import { DebugPanelPlugin } from "@melonjs/debug-plugin";

await app.init();
plugin.register(DebugPanelPlugin, "debugPanel");

Physics adapters are different — they are an Application setting, not a plugin:

import { PlanckAdapter } from "@melonjs/planck-adapter";

const app = new Application(800, 600, {
    parent: "screen",
    // gravity is in pixels/s²; pixelsPerMeter converts it to the adapter's
    // metres. Both are shown at their defaults; subSteps defaults to 1
    physic: new PlanckAdapter({
        gravity: { x: 0, y: 320 },
        pixelsPerMeter: 32,
        subSteps: 2,
    }),
});
await app.init();

melonjs-plugins covers the registry, the version gate and writing your own.

Prefer built-in features

melonJS covers a lot that is easy to reimplement badly. Before hand-rolling, check for: ParticleEmitter and Trail, Tween with easing, the built-in ShaderEffect presets (vignette, scanline, chromatic aberration, glow, dissolve and more), Light2d / Light3d, UIBaseElement / UISpriteElement / UITextButton, NineSliceSprite, TextureAtlas (TexturePacker, ShoeBox, Aseprite), BitmapText, CanvasRenderTarget for bake-once drawing, NoiseTexture2d, viewport.shake / fadeIn / fadeOut, and save for localStorage-backed persistence.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Update older melonJS code for version 20.x. Review the asynchronous Application setup, renderer changes, post-effect API, and deprecated exports so you can identify outdated patterns when migrating or debugging expected APIs.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Migrating a game from melonJS 19.x
  • Checking why an older API is missing
  • Replacing deprecated shader assignments
melonjs/melonJS6.4천2026년 10월 29일 업데이트

Build 3D or 2.5D scenes in melonJS with cameras, meshes, billboards, lights, shadows, and depth sorting. This guide explains the engine’s Y-down and +Z-forward coordinates, camera setup, transparency, and fog, and identifies features that require a GPU renderer instead of the Canvas fallback.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Setting up a Camera3d for a game stage
  • Placing meshes, billboards, or repeated instances
  • Fixing depth order or transparency in a 3D scene
melonjs/melonJS6.4천2026년 10월 29일 업데이트

Load glTF, GLB, or OBJ/MTL assets into melonJS and understand how their materials, lights, animations, shadows, and instances are handled. The guide explains loader options and common format limitations so you can configure scenes and diagnose missing or incorrectly rendered asset features.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Loading a glTF or GLB scene into a melonJS level
  • Adding a static OBJ model with its MTL material
  • Checking why imported materials or lights look different
melonjs/melonJS6.4천2026년 10월 29일 업데이트

Manage sound in melonJS games: load audio, play effects and looping background tracks, control volume, and place sounds in the game world. It also covers generated tones and noise, whole-mix effects, and common causes of silent playback.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Loading sound files and choosing supported audio formats
  • Playing sound effects and looping background music
  • Positioning sounds around a player or game object
melonjs/melonJS6.4천2026년 10월 29일 업데이트

Use this skill to control melonJS cameras and draw shapes, lines, and gradients. It covers target following, camera bounds and effects, coordinate conversion, clipping, rendering into a canvas target, and reading rendered pixels for images or data.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Making a camera follow a player within world bounds
  • Converting pointer or 3D positions to screen coordinates
  • Drawing shapes or gradients in a custom draw method
melonjs/melonJS6.4천2026년 10월 29일 업데이트

Prepare a melonJS game for web builds, native app packaging, or mini-game platforms. The guide covers project scaffolding, browser syntax support, transpiling, asset-loading constraints, and practical bundle-size considerations.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Scaffolding a new melonJS project
  • Preparing a game for iOS or Android packaging
  • Checking support for older browsers
melonjs/melonJS6.4천2026년 10월 29일 업데이트

melonjs의 스킬 모두 보기

이 스킬의 문제 신고