npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

miaoda-game-platformer-phaser

v0.3.3

Published

Phaser 4 Scene controllers for modern and committed miaoda-game-platformer-core movement models, with Arcade-compatible velocity output and plugin lifecycle.

Readme

miaoda-game-platformer-phaser

Use this Phaser 4 adapter to connect miaoda-game-platformer-core to an Arcade-compatible body or a custom velocity applier. The core uses +Y up; the adapter converts vertical velocity for Phaser's +Y-down objects. This is the Arcade-compatible alternative. Do not stack it with miaoda-game-platformer-kinematic-phaser; choose exactly one movement path for an actor.

Install

pnpm add miaoda-game-platformer-phaser miaoda-game-platformer-core

Phaser >=4 <5 is required.

Minimal controller

const controller = scene.platformers.create(player.body, {
  jumpSpeed: 520,
  coyoteTime: 0.1,
  jumpBufferTime: 0.12,
})
  .setInput(() => ({
    moveX: cursors.left.isDown ? -1 : cursors.right.isDown ? 1 : 0,
    jumpPressed: Phaser.Input.Keyboard.JustDown(jumpKey),
    jumpHeld: jumpKey.isDown,
  }))
  .setContacts(() => ({
    grounded: player.body.blocked.down,
    wall: player.body.blocked.left ? -1 : player.body.blocked.right ? 1 : 0,
    bumpedHead: player.body.blocked.up,
  }));

Phaser supplies milliseconds and the adapter converts them to core seconds. Existing autoUpdate: false plus update(deltaMs) integrations remain supported. For a new game-owned fixed-tick loop, prefer explicit gameplay ownership and the seconds boundary:

const controller = scene.platformers.create(
  player.body,
  { jumpSpeed: 520, coyoteTime: 0.1 },
  { tickSource: 'manual' },
).setInput(readLogicalInput).setContacts(readCommittedContacts);

fixedStepper.advance(frameSeconds, (dt) => {
  const gameplay = controller.stepSimulation(dt);
  // Then run the configured Arcade/Matter physics substeps and commit contacts.
});

The default tickSource: 'host' preserves Scene-driven behavior. autoUpdate is a legacy alias; if both options are supplied they must agree. Manual controllers do not register update but retain shutdown cleanup. Calling stepSimulation(dtSeconds) in host mode fails before input/contact providers, core state, body velocity, or snapshot listeners can change. setTicking remains a separate local pause. The same contract applies to createCommitted.

stepSimulation advances platformer gameplay and applies the resulting velocity; it does not step Arcade or Matter. A strict external-physics coordinator should read contact facts committed at the tick boundary, run this gameplay step, execute its configured 1..N physics substeps, capture contacts, and commit one stable contact batch. Do not also leave the Scene physics world on an uncoordinated automatic clock.

Use createCommitted/CommittedPlatformerController for locked-air-control movement and action constraints. Use setVelocityApplier for a deliberately custom integration. For the supported deterministic swept-AABB path, use miaoda-game-platformer-kinematic-phaser rather than connecting this velocity adapter to a second position-owning controller. Do not apply Arcade/Matter movement a second time to the same object.

Public API

PlatformerController, CommittedPlatformerController, PlatformerPlugin, PlatformerControllerOptions, PlatformerTickSource, their input/contact providers, and all core types are exported. Subscribe to snapshots for animation and effects; this package does not resolve custom collision shapes or own the engine physics clock.