| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Full Changelog: 20.1.1...20.2.0
A bug-fix release, and mostly one bug wearing seven faces. Two crashes were reported from a game in production; chasing the first turned up five siblings of the same shape, all fixed here.
The shape: an engine loop hands control to your code, then carries on using state your code was free to tear down. "Remove me when this animation finishes" and "remove it on pickup" are the most ordinary things to write in a callback, and removeChildNow() destroys immediately. Every one of these was reproduced before being fixed, and every fix is pinned by a test that fails against the previous build.
No API changes. No new features. melonjs only.
The two reported crashes
Found by looking for siblings of the first
No breaking changes. Every fix is a guard on a path that previously threw or silently misbehaved. The behaviours a guard could plausibly have damaged are asserted directly: a callback that merely switches animation keeps playing, ordinary frame advance is unaffected, onCollision returning false still opts out of push-out, and self-removal from a container still works.
@melonjs/planck-adapter and @melonjs/matter-adapter are unaffected and need no update — they work off native engine objects rather than the renderable state involved here, which was verified rather than assumed.
npm install melonjs@20.1.1Full details in the CHANGELOG.
Collision events, per shape. A body built from several shapes could only ever report one contact: onCollision and the onCollision* lifecycle surface the single pair chosen for physical resolution, so a character's footprint contact masked a simultaneous hurtbox contact. The new onShapeCollisionStart / onShapeCollisionActive / onShapeCollisionEnd report every overlapping shape pair, without changing which one resolves.
onShapeCollisionStart(contact, other) {
// shapeA / indexShapeA are always YOUR shape
if (contact.indexShapeA === HURTBOX && contact.isTrigger) {
this.takeHit(other, contact.normal);
}
}Each contact carries both shapes, both indices into body.shapes, the trigger status and the SAT data, receiver-symmetric so shapeA is always your own. Supported on all three physics backends: the builtin detector enumerates shape pairs directly, while @melonjs/planck-adapter and @melonjs/matter-adapter dispatch natively, since Box2D reports one contact per fixture pair and matter one per part, and each maps a melonJS shape onto a single collider.
Purely additive. Physical resolution picks the same pair with the same solid-over-trigger preference from 20.0, every existing handler keeps its signature, and on the builtin detector the enumeration is opt-in: declare none of these handlers and the narrowphase does exactly the work it did before.
Requested by a downstream maintainer building on the per-shape collision filtering from 20.0.
No breaking changes. Everything is additive, and the adapter peer ranges stay >=20.0.0: they dispatch these hooks themselves, so the events work on any melonJS 20.x.
| package | version |
|---|---|
| @melonjs/planck-adapter | 1.3.0 |
| @melonjs/matter-adapter | 1.2.0 |
npm install melonjs@20.1.0Full details in the CHANGELOG.
A new WebGPU backend, and WebGL 2 as the baseline. Version 20.0 introduces a complete WebGPU renderer covering the entire engine feature set, 2D and 3D, verified example-for-example against WebGL. At the same time the aging WebGL 1 path is retired, which frees the WebGL backend to modernize throughout. video.AUTO now tries WebGPU first, falls back to WebGL 2 if that is unavailable, and ultimately to Canvas. See the reworked Hello WebGPU example.
This release has breaking changes. Starting a game is now two steps: construct the Application, then await app.init(). Read the Compatibility section below before upgrading.
Measured against 19.9.1 on the same machine, same harness and geometry on both sides:
| 19.9.1 | 20.0.0 | ||
|---|---|---|---|
| 2D, 512 quads/frame, one texture past the batch limit | 33 draws, 1 626 uploads, 4.71 ms/frame | 1 draw, 0 uploads, 0.06 ms/frame | 76x |
| 3D, 64 meshes of 5 000 vertices | 128 draws, 3.80 ms/frame | 64 draws, 0.04 ms/frame | 95x |
Below the texture limit the new path is marginally slower (0.052 to 0.062 ms), the residual being the per-source residency lookup that buys the rest. Also in this release: immutable texture storage across the WebGL pipeline, and Vertex Array Objects for every batcher.
This is a major release with breaking changes.
const app = new Application(640, 480, { parent: "screen" });
await app.init();See the Upgrade Guide for the full migration.
| package | version |
|---|---|
| @melonjs/spine-plugin | 4.0.0 (WebGPU support; requires melonJS 20) |
| @melonjs/planck-adapter | 1.2.0 |
| @melonjs/matter-adapter | 1.1.1 |
| @melonjs/debug-plugin | 16.1.1 |
| @melonjs/tiled-inflate-plugin | 1.2.1 |
npm install melonjs@20.0.0Full details in the CHANGELOG.
19.9.1 is a focused bug-fix release for the 19.9 line — 17 fixes, two long-standing open issues closed, no API additions, drop-in upgrade from 19.9.0.
The headline: video sprites no longer stall in fullscreen. Large videos (1080p/4K) dropped to ~4fps the moment the game went fullscreen while everything else kept rendering at 60 — the browser parks off-DOM video elements on a slow background timer once the page compositor idles, and a fullscreen canvas is exactly what idles it. The engine now keeps a requestVideoFrameCallback pending on the element, which forces full-rate frame delivery, and as a bonus only uploads to the GPU when the video actually presented a new frame.
Also closed: #1231 — the canvas slowly growing on every window resize (alt-tab, devtools) when its container sits inside a wrapper with no fixed CSS size. Two root causes, both fixed: the engine canvas now defaults to display: block (the browser's inline default added a baseline gap that fed back into the auto-scale measurement), and auto-scale measures the container's content box instead of its border box.
npm install melonjs@19.9.1CDN:
<script type="module" src="https://cdn.jsdelivr.net/npm/melonjs@19/+esm"></script>🤖 Generated with Claude Code
Shader effects made easy. Effects that used to demand WebGL expertise, like a pond rippling with the scene reflected in it, heat haze, or frosted glass, now take a few lines of shader code: the engine hands your effect the screen behind it and the right coordinates, animated noise textures come built-in, and shaders preload like any other asset. See the new Water Overworld example for all of it in action, and the updated Shader Effects wiki guide.
No breaking changes — everything additive / back-compatible.
npm install melonjs@19.9.0Full details in the CHANGELOG.
3D grows up. glTF / GLB scene loading lands — author a scene in Blender (or any DCC tool), export a .glb, and load it like a Tiled map with level.load(...), with node animation, authored lighting, and real 3D bounds. And Sprite3d brings the 2.5D workflow: billboarded, frame-animated cut-out sprites that face a Camera3d (the Paper Mario look), sharing one FrameAnimation engine with the 2D Sprite.
No breaking changes — everything additive / back-compatible. Pairs with @melonjs/debug-plugin@16.1.0 (3D bounding-box overlay).
npm install melonjs@19.8.0Full details in the CHANGELOG.
19.7.1 is a focused bug-fix release for the 19.7 line. Three engine bugs and a noise reduction — no breaking changes, no API additions, drop-in upgrade from 19.7.0.
Alongside this release: @melonjs/spine-plugin 3.0.0 ships with Spine 4.3 runtime support, Skeleton.yDown adoption, native WebGL context-loss recovery, and a fully reworked Canvas renderer. The plugin requires melonjs >= 19.7.1 because the blend-cache restore fix below is load-bearing for its lose/restore path.
npm install melonjs@19.7.1CDN:
<script type="module" src="https://cdn.jsdelivr.net/npm/melonjs@19/+esm"></script>🤖 Generated with Claude Code
Highlights: Camera3d perspective camera lands. Every batched shader carries per-sprite depth as vec3 aVertex, unlocking 3D-projected sprites and meshes. Backward compatible with existing 2D code.
npm install melonjs@19.7.0
WebGL context-loss hardening release. Fixes a Windows + Chrome crash where a GPU switch lost the WebGL context and a partial GLShader.destroy() left the next frame's setUniform("uTime", …) reading from null uniforms. Beyond the crash, the renderer now transparently recovers the rest of the pipeline (vertex buffer, default GL state, batchers, texture cache) across a webglcontextlost → webglcontextrestored cycle, and shaders replay their cached uniforms on restore — so the game keeps drawing across a GPU switch without any intervention from user code.
npm install melonjs@19.6.0
| Back | FazBrowse Home | New Git URL |