SkillsReviewed · melonjs

melonJS Sprites and Animation

melonjs-sprites-and-animation is a coding-assistant skill for developers building melonJS sprites and animations, but its version-specific guidance needs checking against the project's engine release. It covers image and atlas sprites, frame playback, visual properties, stretchable panels and pooled objects, with particular attention to positioning and animation-state mistakes.

Researched 17 Nov 2026

In short.

melonjs-sprites-and-animation is a coding-assistant skill for melonJS developers working with sprites and frame animation, but compatibility and runtime behavior remain unverified. Its practical value is the detail around centered anchors, animation callbacks, atlas formats and pooled state. The document discusses behavior associated with melonJS 20.12, 20.13 and 20.14 without establishing a complete compatibility range. No code was executed.

Researched and written by an AI model and checked by a second AI model. How it works

The supplied manifest covers the complete selected folder packages/melonjs/skills/melonjs-sprites-and-animation at revision 837bd09106a0dcd1f4e4925a2b8a25cbcbdfc33c, containing SKILL.md, plus the repository-root LICENSE.md outside that folder. Engine source, referenced companion skills, assets and tests are outside the supplied material. No code was executed; compatibility, runtime behavior, performance and assistant integration remain unverified.

The overview

Identity

The resource is SKILL.md in packages/melonjs/skills/melonjs-sprites-and-animation within the melonjs/melonJS repository. Its metadata names it melonjs-sprites-and-animation and identifies sprite creation, frame animation and texture atlases as its intended topics.

It supplies instructions and JavaScript examples for a coding assistant to consult while working on a melonJS project.

Assessment

The strongest material explains mistakes that can produce plausible but incorrect results: treating a sprite's center as its top-left corner, repeatedly multiplying its scale, restarting a finished one-shot animation and retaining state when recycling objects.

The guidance is specific enough to inform implementation and debugging. Its correctness against engine source, effects on assistant output and practical performance have not been assessed.

Users

It fits developers already using melonJS, including beginners learning sprite placement and experienced developers managing atlas animations, callbacks or frequently spawned objects.

Beginners need some JavaScript knowledge and an existing project that can load assets and display game objects. The file assumes that surrounding application setup rather than teaching a complete game from scratch.

Capabilities

The skill explains creating sprites from images or atlas regions, defining animation frames and delays, switching animations, chaining playback, handling completion and frame callbacks, and pausing or stopping playback.

It covers TexturePacker, Free Texture Packer, Aseprite JSON and binary assets, ShoeBox exports, fixed-cell sheets and multi-page atlases. It also addresses tint, transparency, flipping, scaling, flicker, NineSliceSprite panels and createPool-based recycling.

Using it

Requirements

The examples assume an existing JavaScript melonJS application, access to the named engine APIs and preloaded assets. Image sprites need image data; atlas sprites need compatible metadata and image data. Animation grids need the intended frame dimensions.

Supported assistant hosts, skill-discovery requirements, browser or Node.js minimums and a complete engine-version compatibility matrix are not supplied.

Mechanism

The document combines topic metadata, API examples and symptom-to-cause explanations. Its metadata names concepts such as Sprite, TextureAtlas, anchorPoint and animation callbacks; whether an assistant automatically discovers it depends on the host and is unknown.

The central positioning rule is that Renderable defaults to anchorPoint (0.5, 0.5), making a sprite's position its center, while Container uses (0, 0). Animation examples distinguish looping playback, explicit one-shot playback and transitions to another animation.

Setup

For the code examples, first make the required image or atlas assets available through the melonJS loader. Choose the sprite's anchor and frame dimensions explicitly, then define and select its animations. Atlas examples construct TextureAtlas from loaded JSON and image data.

The file refers readers to melonjs-getting-started for preloading. It does not provide a complete application entry point or instructions for installing the skill into a particular assistant.

Example

For a preloaded hero spritesheet containing at least four 32-by-32 frames, the documented pattern is: const hero = new Sprite(100, 100, { image: "hero", framewidth: 32, frameheight: 32 }); hero.addAnimation("idle", [0, 1, 2, 3], 100); hero.setCurrentAnimation("idle");

According to the skill, the animation repeats with 100 milliseconds per frame. Set hero.anchorPoint.set(0, 0) if position (100, 100) should identify the top-left corner. This fragment assumes Sprite is available and loading and scene insertion are handled elsewhere; it has not been executed.

Assessment & evidence

Limitations

Several details depend on engine version. The text associates animation-redefinition and flicker fixes with 20.13, missing-frame warnings and omission with 20.14, and certain one-frame completion behavior with 20.12. These claims have not been checked against implementation.

The document supplies no benchmarks or measured batching improvements. Runtime correctness, assistant compatibility and integration behavior are unverified. Its crossfade discussion explicitly limits that option to GLTFModel; sprites ignore it.

Reasoning

The detail around state transitions could be especially useful for debugging. For example, the text explains that selecting a finished loop: false animation restarts it, and that recycled objects must restore every property changed during their previous use.

That specificity suggests a useful reference for an existing melonJS project. Any reduction in debugging time or improvement in generated code remains unknown.

Alternatives

For adjacent needs, the file points to melonjs-renderables for anchors, draw order and custom drawing; melonjs-getting-started for preloading; and melonjs-3d-assets for GLTFModel behavior.

Those companion resources were not supplied, so their contents and relative usefulness are unknown. The evidence does not support a comparison with other engines or sprite-development tools.

Evidence

The source text is available at a fixed repository revision: [https://raw.githubusercontent.com/melonjs/melonJS/837bd09106a0dcd1f4e4925a2b8a25cbcbdfc33c/packages/melonjs/skills/melonjs-sprites-and-animation/SKILL.md]. It contains the API descriptions, examples and troubleshooting claims discussed here.

The accompanying licence is [https://raw.githubusercontent.com/melonjs/melonJS/837bd09106a0dcd1f4e4925a2b8a25cbcbdfc33c/LICENSE.md]. Engine implementation, executable tests and independent performance evidence are not included.

Access & freshness

Costs

The MIT notice grants permission to use the software free of charge. The supplied material gives no assistant-service pricing, model usage estimates, asset prices or integration-effort estimates.

Total cost for using the skill within a development setup is unknown.

Rights

SKILL.md declares MIT licensing. The accompanying repository LICENSE.md permits use, copying, modification, distribution, sublicensing and sale, provided its copyright and permission notice accompany copies or substantial portions.

The notice attributes copyright to Olivier Biot (AltByte Pte Ltd), 2011–2023, and disclaims warranties and liability. Separate rights for images, atlas artwork or other project assets are not established by these files.

Freshness

The supplied snapshot was captured on 17 November 2026 at revision 837bd09106a0dcd1f4e4925a2b8a25cbcbdfc33c. That capture date does not establish when the skill was last edited.

The text discusses versions 20.12, 20.13 and 20.14. The current published melonJS version and subsequent changes to this skill are unknown.

Actions

Before applying the examples, establish the project's melonJS version, confirm frame dimensions and atlas region names, and choose the intended anchor explicitly.

In the target project, verify that one-shot animations complete without repeated restarts, frame callbacks fire as intended and pooled objects reset visual and animation state. Assess atlas batching with project-specific measurements if performance matters.

Evidence for this report

LICENSE.mdnotice · checked 2026-11-17