Sign in Get 3 free credits

Try a job or a niche: tiktok captions, study notes, excel formulas. Press Esc to close.

melonJS physics and collision

Sets up collision, physics bodies and the right physics engine in melonJS, so game objects move and collide well.

Claude's review

7/10 Detailed adapter choice guide and silent failure notes for melonJS physics.

We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.

In detail

Use this skill for collision, physics bodies, movement, and spatial queries in melonJS: the built-in SAT world and the planck, matter, Rapier and Rapier 3D adapters. Covers bodyDef vs Body, collision types and masks, the collision callback family and their firing rules, raycast/queryAABB/querySphere, how the adapters differ, and which one to pick for a given game. Triggers on: which physics engine, choosing an adapter, switching adapters, setAdapter, PhysicsAdapterClass, create, rotation collision, rotating body, torque, joints, addJoint, removeJoint, hinge, rope, weld, slider, stacking, Body, bodyDef, collision, collisionType, collisionMask, onCollision, onCollisionStart, onCollisionActive, raycast, queryAABB, querySphere, raycast3d, PlanckAdapter, MatterAdapter, RapierAdapter, Rapier3dAdapter, enableCcd, gravity, velocity, applyForce, isGrounded, isSleeping, isSensor, isTrigger, onShapeCollisionStart, kinematic, subSteps, pixelsPerMeter, Box3d, Sphere, getBodyShapes, Capsule3d, TriangleMesh3d, slope, SAT.

How you use it

  1. Add it to your pack, then download your pack (1 credit).
  2. In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
  3. Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide

Safety check

Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.

An automated scan lowers risk but cannot promise zero risk. How we check skills

Preview

The first lines of SKILL.md
---
name: melonjs-physics
description: "Use this skill for collision, physics bodies, movement, and spatial queries in melonJS: the built-in SAT world and the planck, matter, Rapier and Rapier 3D adapters. Covers bodyDef vs Body, collision types and masks, the collision callback family and their firing rules, raycast/queryAABB/querySphere, how the adapters differ, and which one to pick for a given game. Triggers on: which physics engine, choosing an adapter, switching adapters, setAdapter, PhysicsAdapterClass, create, rotation collision, rotating body, torque, joints, addJoint, removeJoint, hinge, rope, weld, slider, stacking, Body, bodyDef, collision, collisionType, collisionMask, onCollision, onCollisionStart, onCollisionActive, raycast, queryAABB, querySphere, raycast3d, PlanckAdapter, MatterAdapter, RapierAdapter, Rapier3dAdapter, enableCcd, gravity, velocity, applyForce, isGrounded, isSleeping, isSensor, isTrigger, onShapeCollisionStart, kinematic, subSteps, pixelsPerMeter, Box3d, Sphere, getBodyShapes, Capsule3d, TriangleMesh3d, slope, SAT."
license: MIT
---

# Physics and collision

> melonJS has a built-in SAT collision world and three optional rigid-body
> adapters. Movement, collision callbacks and spatial queries all behave
> differently depending on which is active — and several of the differences fail
> silently.

## Choosing a world

| | when | joints (`world.addJoint()`) |
|---|---|---|
| **built-in** (default) | Arcade-style: platformers, top-down games. Fast, position-based, not Newtonian. | ❌ throws |
| **`@melonjs/planck-adapter`** | Full rigid-body dynamics: stacking, realistic restitution. | ✅ hinge, rope, weld, slider |
| **`@melonjs/matter-adapter`** | Same class of thing, backed by matter-js. | ❌ throws (matter's own constraints, through `adapter.matter`) |
| **`@melonjs/rapier2d-adapter`** | Same again, backed by Rapier compiled to WebAssembly: many bodies, per-body continuous collision, a character controller. Loaded asynchronously. | ✅ hinge, rope, weld, slider |
| **`@melonjs/rapier3d-adapter`** | A `Camera3d` game whose bodies move, tumble and stack in 3D, written back onto a `Mesh` or `GLTFModel`. 3D shapes only. Loaded asynchronously. | ✅ the same four, with 3D anchors and axes |

### Picking one

Start with the built-in. It is the default for a reason: no dependency, the
smallest bundle, and its position-based model is what most 2D games actually
want — a platformer's jump arc is a designed curve, not a simulated one, and
tuning gravity against a solver you are fighting is a bad afternoon.

**Move to an adapter when the game needs something the builtin cannot express**,
and these are the usual triggers:

- **Rotation that collides.** The clearest signal. The builtin's SAT never reads
  `body.angle`, so a spinning shape collides as though it never turned. See
  the note in *Built-in world quirks* below.
- **Torque, angular velocity, or spin from an impact.** Anything that should
  start turning *because* it was hit.
- **Joints and constraints** — ragdolls, chains, ropes, vehicles, hinged doors.
  The builtin has no concept of them.
...

From melonjs's repository, MIT licence.

Related skills

  • Checked

    Game Audio Mixing

    Sets up game audio buses, volume sliders, music ducking and adaptive music for Godot, Unity or FMOD.

    by gamedev-skills 13k
    8/101 credit
  • Checked

    Game camera tuning

    Builds and tunes follow, orbit and first person game cameras in Godot or Cinemachine so they stop jittering.

    by gamedev-skills 13k
    8/101 credit
  • Checked

    Game Enemy AI

    Designs enemy AI with perception, pathfinding and steering so enemies chase fairly and never get stuck.

    by gamedev-skills 13k
    8/101 credit
  • Checked

    Game Loop and Timing

    Makes movement, timers and physics behave the same at any frame rate in Unity, Godot, Bevy and web games.

    by makifbaysal 123
    7/101 credit
  • Checked

    Godot Game Testing

    Writes and runs Godot tests with gdUnit4 or GUT, including scene tests and headless runs that report real results.

    by makifbaysal 123
    7/101 credit
  • Checked

    Game Security Review

    Reviews Unity, Godot and Unreal code for cheats that hurt other players, purchase exploits and unsafe save files.

    by makifbaysal 123
    7/101 credit

Secure checkout

Credits

AUD

  1. 1Choose
  2. 2Pay on Square
  3. 3Credits added