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

make2d

v9.38.9

Published

Game FrameWork for JavaScript 2D WebGL Canvas Games

Downloads

47

Readme

make2d

@

make2d is a lightweight game framework for building 2D WebGL games in JavaScript.

It provides a Unity-inspired architecture on top of PIXI.js, focusing on:

  • predictable object hierarchy
  • safe lifecycle management
  • efficient collision detection
  • reactive, composable update loops

highlights

  • fast, mobile-friendly rendering (PIXI.js)
  • Unity-like scene & entity hierarchy
  • lifecycle-safe object destruction
  • efficient 2D collision system (check2d)
  • RxJS-driven update & event model

demo

👉 https://nenjack.github.io/make2d/demo/?fps&debug


demo code

import { Scene, GameObject } from 'make2d'
import { takeUntil } from 'rxjs'

const scene = new Scene({
  visible: true,
  autoSort: true
})

// scene-level update loop
scene.update$.pipe(takeUntil(scene.destroy$)).subscribe(() => {
  scene.physics.separate()
})

const gameObject = new GameObject('Entity Name')
scene.addChild(gameObject)

// game object update loop
gameObject.update$
  .pipe(takeUntil(gameObject.destroy$))
  .subscribe((deltaTime) => {
    gameObject.update(gameObject, deltaTime)
  })

demo structure

[HTML5 Canvas + WebGL]
└── [Scene]
    └── [Collision System]
        └── [GameObject x 50]
            ├── [Body]
            └── [Animator]
                └── [StateMachine]

The hierarchy and API are intentionally similar to Unity, making it easy to reason about complex scenes.


why make2d?

When building multiple indie and HTML5 WebGL games, a few recurring problems show up:

  1. managing deeply nested game entities
  2. avoiding memory leaks during object destruction
  3. keeping update logic predictable and composable

make2d addresses these by design, using a strict hierarchy and lifecycle model inspired by Unity.


lifecycle & update model

Every object in make2d participates in a tree-based lifecycle.

Examples:

  • tank → turret → ammo
  • house → furniture → props

lifecycle guarantees

  • All framework classes implement Lifecycle

  • Destroying any object:

    • emits and completes destroy$
    • recursively destroys all children
  • RxJS subscriptions can safely bind to destroy$

update propagation

  • Every object exposes an update$ observable
  • Updates flow top-down through the hierarchy
  • When a parent updates, all children update automatically
  • deltaTime is provided each frame

This makes it easy to compose behavior without manual bookkeeping.


exports

make2d provides a small but complete set of building blocks:

core

  • Lifecycle – destroy entire branches safely
  • Component – base class for attachable behavior
  • GameObject – Unity-like entity container
  • Scene – root container and game entry point
  • SceneSSR – Scene replacement for Node.js

rendering & containers

  • ContainerPIXI.Container + lifecycle
  • SpritePIXI.Sprite + lifecycle
  • Animator – manages multiple PIXI.AnimatedSprite
  • TextureAtlas – atlas frame slicing

state & structure

  • StateMachine – simple state handling
  • Prefab – declarative entity creation
  • Resources – asset loader

physics

  • CircleBody – circular collider
  • BoxBody – rectangular collider
  • PolygonBody – polygon collider

installation

yarn add make2d

documentation

  • API reference https://nenjack.github.io/make2d/modules.html
  • Lifecycle & hierarchy https://nenjack.github.io/make2d/hierarchy.html

license

MIT