Repository navigation
Home
Olivier Biot edited this page Aug 5, 2026
·
128 revisions
Welcome to the melonJS wiki â your guide to building 2D and 3D games with melonJS.
New to melonJS? Start here:
npm create melonjs my-game
cd my-game
npm install
npm run dev- FAQ â common questions and answers
- Beginner Tutorial: Platformer Game â step-by-step guide to building your first game
- Boilerplate â ready-to-go project template with TypeScript and Vite
- Live Examples â interactive demos showcasing engine features
- The Core Engine â game loop, states, and the Application class
- Renderables â Renderable, Sprite, Text, and BitmapText
- Container â scene graph, child management, and nesting
- Adding and Managing Game Objects â world container, z-ordering, object pool, persistence
- Resources & Asset Loading â preloading images, audio, maps, and fonts
- Rendering API â full API reference with Canvas 2D comparison, gradients, dashed lines, bezier curves, and more
-
Shader Effects â built-in post-processing effects on both GPU backends (glow, shine, blur, âĶ), writing your own (GLSL and/or WGSL bodies), screen-reading effects (
screen_texture/screen_uv/noise_uv), custom mesh shaders, and preloading shaders as assets - API Documentation â auto-generated API docs
-
Working in 3D â general concepts:
Camera3dopt-in, conventions (Y-down + +Z forward),Mesh/ OBJ rendering (retained on both GPU backends), lighting (Light3dâ directional/ambient/point/spot), sprites + depth, and frame-rate-independent smoothing (math.damp). Worked example: AfterBurner showcase. - Loading & supported 3D assets â the asset pipeline (OBJ/MTL), and what's supported vs. not across geometry, materials/textures, animation, and lighting.
-
Loading glTF / GLB scenes â import a whole Blender-authored scene (node graph, meshes, camera, lights, node animation) and place each node as a
Mesh. -
3D spatial queries â
Sphere,world.adapter.querySphere,raycast3d, and bulk frustum culling (Camera3d.queryVisible). - 2.5D games (Paper Mario-style) â perspective camera for depth, gameplay on a flat Z plane.
- Adding a Physics Body â body, shapes, velocity, friction, and collision types
- Collision Shapes â Rect, Ellipse, Polygon, Line, and RoundRect
- Defining Collision Shapes in Tiled â drawing collision layers in the Tiled map editor
-
Migrating to the Physics Adapter API â moving from the legacy
new me.Body(this, shape)pattern to the 19.5 declarativebodyDef+ body method API (all on the built-in adapter) -
Switching Physics Adapters â using
@melonjs/matter-adapter, expected differences, porting checklist, recipes - BuiltinAdapter Quirks â SAT-specific behaviors that don't carry to other engines â patterns to avoid baking into code that might switch adapters later
- Tiled Map Editor â the map editor used by melonJS
- Defining Collision Shapes in Tiled â collision layers and shape types
- melonJS Particle Studio â visual particle editor
- Using TexturePacker â create and use texture atlases
- Using SpriteIlluminator â per-pixel sprite lighting with normal maps
- Using PhysicsEditor â import complex collision shapes
- Using Bitmap Fonts â generate and render bitmap fonts
- Discord â chat with the melonJS community
- Made with melonJS â games and demos built with melonJS
- Upgrade Guide â API changes between versions
- Upgrading to melonJS 2 â migrating from ES5/Legacy to ES6 classes
- Contributing â how to contribute to melonJS
- MDN JavaScript Guide â comprehensive reference by Mozilla
- Eloquent JavaScript â free online book