Package Exports
- @beatdiaz/2d-grid-engine
- @beatdiaz/2d-grid-engine/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@beatdiaz/2d-grid-engine) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@beatdiaz/2d-grid-engine A lightweight, high-performance, and general-purpose 2D grid management engine. Designed to handle spatial data, layers, and entities without forcing any specific game logic.
Features: 🏗 Layer-based architecture: Manage terrain, actors, effects, and more in separate layers.
🧩 Registry System: Define your tiles and entities once, reuse them everywhere.
🚀 Zero Dependencies: Lightweight and fast, built with pure ES Modules.
🛠 Agnostic: Use it for games, floor plans, simulations, or any grid-based data.
Installation: npm install @beatdiaz/2d-grid-engine
Quick Start: import { GridManager, TileRegistry } from '@beatdiaz/2d-grid-engine';
// 1. Initialize the Grid (Rows, Cols) const world = new GridManager(10, 10);
// 2. Setup a Layer world.addLayer("terrain", "GRASS");
// 3. Register your data const tiles = new TileRegistry(); tiles.register("WALL", { walkable: false, color: "#000" });
// 4. Manipulate the grid world.setCell("terrain", { row: 5, col: 5 }, "WALL");
console.log(world.getCellValue("terrain", { row: 5, col: 5 })); // "WALL"
License: MIT