hazo_arcade
v2.1.0
Published
Reusable PixiJS game engine — scene management, game loop, input, audio, config, logging, collision, parallax, and utilities
Maintainers
Readme
hazo_arcade
Reusable PixiJS 8 game engine library providing scene management, game loop, input, audio, config, collision, parallax, animation, effects, storage, UI tools, and Vite plugins.
Install
npm install hazo_arcade hazo_core pixi.jshazo_core is a required peer dep (provides the workspace-standard HazoError
subclasses, correlation IDs, config loader, and logger factory used by the
engine). hazo_ui is an optional peer dep used only by the React UI modules.
Modules
Each module has its own subpath export — import only what you need:
import { initApp, SceneManager, GameLoop } from "hazo_arcade/core"
import { AudioManager } from "hazo_arcade/audio"
import { KeyboardInput } from "hazo_arcade/input"
import { parseIni, loadIni } from "hazo_arcade/config"
import { ConsoleLogger } from "hazo_arcade/logging"
import { circlesOverlap, rectCircleOverlap } from "hazo_arcade/collision"
import { ParallaxBackground } from "hazo_arcade/parallax"
import { SpriteAnimator } from "hazo_arcade/animation"
import { ScreenFlashEffect, createShadow } from "hazo_arcade/effects"
import { LeaderboardStore, CurrencyStore } from "hazo_arcade/storage"
import { loadJson } from "hazo_arcade/utils"Or import everything from the barrel:
import { initApp, AudioManager, KeyboardInput, ... } from "hazo_arcade"Engine Modules
| Module | Description |
|--------|-------------|
| core | App singleton, scene manager (stack-based push/pop/replace), fixed-timestep game loop, event bus, object pool |
| audio | AudioManager wrapping @pixi/sound with mute persistence, SFX registration, music phases |
| input | Generic keyboard input with action-to-keycode bindings |
| config | INI parser with typed helpers, async fetch+cache loader |
| logging | Console logger with levels and per-category overrides |
| collision | Circle-circle and rect-circle overlap detection |
| parallax | Multi-layer vertical scrolling background |
| animation | Frame-by-frame sprite animation with states and play modes |
| effects | Screen flash, expanding ring, drop-shadow utilities |
| storage | LocalStorage/sessionStorage backed leaderboard and currency stores |
| utils | Async JSON loader with caching |
UI Modules (React)
React-based development tools for sprite and audio management. These require React 18+ and related peer dependencies.
import { HazoSpriteManager } from "hazo_arcade/ui/sprite-manager"
import { HazoSoundManager } from "hazo_arcade/ui/sound-manager"
import { HazoUiSoundPlayer } from "hazo_arcade/ui/sound-player"
import { FrameExtractor } from "hazo_arcade/ui/frame-extractor"
import { EditableFilename, BulkOperationToolbar } from "hazo_arcade/ui/shared"
import { useAudioLibrary, useSoundAssignments, useMusicAssignments } from "hazo_arcade/ui/hooks"
import { formatTimeMs, parseTimeMs, cn } from "hazo_arcade/ui/utils"Vite Plugins
Build-time plugins for sprite sheet and audio asset processing:
import { spriteEditorPlugin, audioPlugin } from "hazo_arcade/vite"Peer Dependencies
Required:
hazo_core^1.0.0 — error classes, correlation IDs, config loader, loggerpixi.js^8.0.0
Optional (engine):
@pixi/sound^6.0.0 — for audio modulehazo_ui^3.0.1 — forcn()and the React UI modules
Optional (UI tools):
react^18.0.0 || ^19.0.0,react-dom^18.0.0 || ^19.0.0radix-ui^1.0.0,lucide-react^0.553.0class-variance-authority^0.7.0,clsx^2.1.1,tailwind-merge^3.5.0rc-slider^11.0.0@imgly/background-removal^1.5.0jszip^3.10.0
Optional (build tools):
vite^5.0.0
Tailwind CSS v4
If your project uses Tailwind CSS v4, add a @source directive so Tailwind scans the package's classes:
@import "tailwindcss";
@source "../node_modules/hazo_arcade/dist";Requirements
- Node.js >= 18
- ESM only (
"type": "module")
License
MIT
