Simple 2D TypeScript game engine using WebGPU and Rapier physics.
Ships as the teengine npm package. This repo is a monorepo: library in packages/teengine, demo in examples/demo.
npm install
npm run devOpen http://localhost:5173 — a Steam-style store page listing all demo games.
| Game | Description | Controls |
|---|---|---|
| Space Invaders | Classic arcade shooter with marching formations | Arrow / A D move, Space fire |
| Platformer Prototype | Physics sandbox with coins and enemies | WASD / Arrows move, Space jump |
Each demo opens in its own page. Use ← Store to return to the launcher.
GitHub Pages does not let you pick examples/demo as a source folder — only / (root) or /docs appear in Settings. This repo uses a GitHub Actions workflow instead:
- Merge to
main - Repo Settings → Pages → Build and deployment → Source: choose GitHub Actions
- The
Deploy demo to GitHub Pagesworkflow buildsexamples/demoand publishes the Vite output
Your store will be live at:
https://dioveath.github.io/teengine-js/
(Replace dioveath / teengine-js if you fork or rename the repo.)
npm install teengineimport { Engine, World, PhysicsBridge, PhysicsWorld, Layers, Color } from "teengine";
const engine = await Engine.create({ canvas });
const physics = new PhysicsBridge(await PhysicsWorld.create());
const world = new World(physics);
// … register layers, spawn entities, add systemsSee docs/PACKAGE.md for monorepo layout and docs/ARCHITECTURE.md for engine design.
| Command | Description |
|---|---|
npm run dev |
Build engine + run demo |
npm run build |
Build teengine package |
npm run build:demo |
Build engine + demo |
npm run typecheck |
Typecheck all workspaces |
packages/teengine/ → publishable library (`teengine`)
examples/demo/ → Vite demo store + game pages
docs/ → architecture + package docs
legacy/ → original Canvas 2D prototype
MIT — personal learning project by @dioveath.