A hackable template for creating small and fast browser games.

Goodluck is great for:

Getting Started

Goodluck is not a typical library. You don't install it via npm install. Instead, use it as a template: generate a new repository from it, remove features you don't need, and hack away. Consult the README to learn more.

Generate a new repo on GitHub


Goodluck is a template for creating small browser games which fit in a few kilobytes. Apart from the game loop and the rendering pipeline, Goodluck doesn't give you much more code. We like to think of Goodluck as a set of good practices, architecture decisions, and tools.

  1. Write code that you need just for this game. Don't design extensible abstractions. Your goal is to ship a game, not to build an engine.
  2. Write data-driven code. Goodluck uses the ECS architecture; separate the data (components) from the logic (systems).
  3. Prefer simple procedural code and closed type systems. E.g. instead of designing class inheritance hierarchies, use union types and switch between the variants.


All examples are WebGL2. The reported size is minified and gzipped.

Starter Templates