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-isometric-core

v0.2.0

Published

Engine-agnostic isometric grid projection with reversible world/screen transforms, elevation support and deterministic cell picking. No rendering or engine dependency.

Readme

miaoda-game-isometric-core

Use this engine-independent coordinate helper for isometric tile games, tactics maps, builders, and management views. It projects continuous grid coordinates to screen coordinates, reverses that transform on a known elevation plane, picks cells, and returns cell diamonds for your renderer.

Install

pnpm add miaoda-game-isometric-core

Project and pick a cell

import { IsometricProjection } from 'miaoda-game-isometric-core';

const iso = new IsometricProjection({
  tileWidth: 64,
  tileHeight: 32,
  elevationHeight: 24,
  origin: { x: 640, y: 80 },
});

const screen = iso.worldToScreen({ x: 4.25, y: 7.5, z: 1 });
const cell = iso.screenToCell(pointerPosition, 0); // ground plane
const diamond = iso.cellDiamond(cell, 0);           // four draw vertices

The transform is:

screenX = originX + (worldX - worldY) * tileWidth / 2
screenY = originY + (worldX + worldY) * tileHeight / 2 - worldZ * elevationHeight

World (x, y) is continuous. Integer cell (x, y) is the top vertex of the area [x, x + 1) × [y, y + 1); screenToCell uses floor, including for negative coordinates.

Elevation matters

screenToWorld(screen, z) and screenToCell(screen, z) need the elevation plane you intend to pick. The same screen point can represent ground, a bridge, or a roof, so the projection cannot infer z from pixels alone. Keep tile storage, navigation, collision, and layer selection in your game or grid package.

tileWidth and tileHeight are independent; 64 × 32 is a common 2:1 diamond but is not required. elevationHeight controls how far one elevation unit moves upward on screen.

Rendering boundary

Use cellDiamond for tile drawing or hit-test overlays. Draw ordering depends on each object's footprint, height, overhangs, and bridge rules; this package intentionally does not prescribe a universal x + y + z sort key. Apply your engine's actual object bounds and layer policy.

Public API

IsometricProjection, IsoPoint, IsoCell, IsometricProjectionOptions, and Vec2 are exported. The core does not render sprites, store a map, navigate, or create engine nodes; compose it with miaoda-game-grid-core and your target engine's TileMap/scene APIs.