Craters — TypeScript HTML5 Game Framework

Craters logo

View on GitHub  ·  Documentation  ·  Play sandbox

Craters is a modular TypeScript framework for HTML5 game development, built around the Entity-Component-System (ECS) pattern. It gives developers a composable foundation for browser-based games without engine lock-in or heavy dependencies.

Features:

  • ECS CoreWorld, Entity, System, Query for managing all game logic
  • Physics — Impulse-based RigidBody with forces, damping, friction, and restitution; 2D Vector math
  • Collision Detection — SAT (Separating Axis Theorem) for circles and convex polygons; QuadTree for broad-phase spatial partitioning
  • Rendering — WebGL sprite batching renderer + Canvas2D fallback with primitive drawing support
  • Input — Unified keyboard, mouse, and touch handling via KeyboardEvent.code
  • Sound — Web Audio API wrapper (SoundManager, Sound) for effects and music
  • Asset Management — Async loaders for images, JSON, text, binary blobs, and fonts
  • Tilemaps — Load and render Tiled-format JSON maps
  • Particles — Sprite-based particle system with per-particle gravity, drag, tinting, and directional bias

Install:

npm install craters

MIT licensed. 26 stars on GitHub.

comments powered by Disqus