This repository contains Draug Engine, a TypeScript game engine focused on clear ECS-based architecture and reusable gameplay building blocks.
The main package is @draug/engine, an ECS-first game engine core built around entities, components, systems, resources, events, commands, and plugins. The goal is to keep the engine small and understandable, while still giving a game enough structure to grow beyond a single update loop full of unrelated logic.
packages/enginecontains the source for the published@draug/enginepackage. This is where the ECS core, runtime helpers, event buffers, command queue, and plugin system live.apps/flappy-birdis a small playground application that I use to test the engine in a browser game scenario.pluginscontains standard Draug plugins, such as the published@draug/config-plugin. These are reusable pieces of engine functionality that can be installed into a game instead of being copied between projects.
Draug is not trying to be a full editor-driven engine. It is closer to a lightweight foundation for games written in TypeScript.
I want the engine to make common game code easier to organize: data goes into components, frame logic goes into systems, shared state goes into resources, and optional features can be packaged as plugins. The repository also gives me a place to build small example games while the engine API is still evolving.
apps/
flappy-bird/ Example browser game built with the engine
packages/
engine/ Main @draug/engine package
types/ Shared helper types
plugins/
config/ Standard configuration plugin
The engine is published as an npm package:
npm install @draug/engineStandard plugins are published separately. For example, the configuration plugin can be installed with:
npm install @draug/config-pluginThe repository itself uses Yarn workspaces for developing the engine, plugins, and example app together.
yarn installTo run the Flappy Bird example from this repository:
yarn workspace flappy-bird devTo build the engine package locally:
yarn workspace @draug/engine buildThe engine package has its own README with a more complete API overview and examples: packages/engine/README.md.
The root README is intentionally short. It is meant to explain what this repository is and where to start, not to document every engine API.