Goodluck
A hackable template for creating small and fast browser games.
Goodluck is great for:
- Learning game programming and game design.
- Prototyping gameplay ideas.
- Building size-constrained games.
- Experimenting with algorithms and APIs.
- Modeling problems through animated simulations
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.
Features
Goodluck is a template for creating small browser games which fit in a few kilobytes. It's designed for extreme hackability. The codebase is small and simple; it's mostly just if
s and for
s. The code is easy to understand and modify.
- A tiny core with an expressive and fast ECS implementation, which keeps the data (components) separate from the logic (systems).
- 2D rendering pipeline using WebGL's instancing, resulting in very good performance (tens of thousands of sprites).
- 3D rendering pipeline supporting Gouraud and Phong shading with gamma-corrected directional and point lights; diffuse, specular, and normal texture mapping; real-time shadows; forward and deferred rendering, both with a post-processing step; instanced rendering, and more.
- A versatile toolkit of useful systems for movement, animation, collisions, particles, entity life cycle (spawn, autodestruct), UI, mouse, keyboard, touch and gamepad input, etc.
- Capable of great performance, even on older mobile devices.
Documentation
- What is Goodluck?
-
A high-level overview of what makes Goodluck special. It also includes an honest list of reasons why you might want to consider other solutions.
- Why is Goodluck the way it is?
-
A list of questions you might be asking yourself with regards to Goodluck's design choices.
- API Reference
-
The annotated source code of Goodluck's core components, systems, and utilities.
Tutorials
- js13kBreakout (2022)
-
Part of the js13kBreakouts project.
- Castle Peskenstein (2020)
-
A Twitter thread with a step-by-step account of creating a Wolfenstein3D clone.
- Breakout (2020)
-
Support material from a workshop on gamedev. Follow the commits on the tutorial branch.